Use the pre-made DropHat RemoteEvent.

This commit is contained in:
Max G 2019-11-10 21:28:38 -06:00 committed by GitHub
parent 1333f4c427
commit 498eb67312
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -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)