Hello! I am trying to make a morph pad that requires the player, However when I have GetPlayerFromCharacter() it registers it as a W001 error.
script.Parent.Touched:Connect(function(hit)
local hum = hit.Parent:FindFirstChild("Humanoid")
if hum ~= nil then
GetPlayerFromCharacter(hum.Parent)
end
end)
I also tried using GetPlayerFromCharacter(hit) but it still registers it as a W001.

1 comment
that is a bad way of doing it, first off touched wont be nil since the event triggered because it was touched, second off connecting the event to a named function like you do it is just stupid, just connect the event directly instead of naming a function