The error I get is 'player argument must be a Player Object'.

I'm pretty sure it is a player object, but the script says it isn't any help would be nice.

local inorout

script.Parent.Touched:Connect(function(hit)
	inorout = "In"
	local player = game.Players:GetPlayerFromCharacter(hit.Parent)
	game.ReplicatedStorage.UpgradeOpenEvent:FireClient(player, inorout)
end)

script.Parent.TouchEnded:Connect(function(hit)
	inorout = "Out"
	local player = game.Players:GetPlayerFromCharacter(hit.Parent)
	game.ReplicatedStorage.UpgradeOpenEvent:FireClient(player, inorout)
end)

1 comment

0

OOF. I forgot to check if the touch is a humanoid.