Use the pre-made DropHat RemoteEvent.
This commit is contained in:
parent
1333f4c427
commit
498eb67312
|
|
@ -6,9 +6,7 @@ local torso = char:WaitForChild("HumanoidRootPart")
|
|||
local humanoid = char:WaitForChild("Humanoid")
|
||||
local hatPickup = script:WaitForChild("HatPickup")
|
||||
|
||||
local dropHat = Instance.new("RemoteEvent")
|
||||
dropHat.Name = "DropHat"
|
||||
dropHat.Parent = script
|
||||
local dropHat = script:WaitForChild("DropHat")
|
||||
|
||||
local function onDropHat(player)
|
||||
local myPlayer = Players:GetPlayerFromCharacter(char)
|
||||
|
|
@ -47,4 +45,4 @@ local function onDropHat(player)
|
|||
end
|
||||
end
|
||||
|
||||
dropHat.OnServerEvent:Connect(onDropHat)
|
||||
dropHat.OnServerEvent:Connect(onDropHat)
|
||||
|
|
|
|||
Loading…
Reference in New Issue