Why can I not get the player that touches my part?
Asked by
4 years ago Edited 4 years ago
01 | script.Parent.Touched:Connect( function (hit) |
03 | if hit.Parent:FindFirstChild( "Humanoid" ) then |
04 | local player = workspace [ hit.Parent.Name ] |
05 | local plr = game.Players:GetPlayerFromCharacter(player) |
07 | plr.owned.nofood.Value = false |
21:48:04.055 - Workspace.Map.weGYM.Foodallowed.Script:7: attempt to index nil with 'owned'
21:48:04.055 - Stack Begin
21:48:04.055 - Script 'Workspace.Map.weGYM.Foodallowed.Script', Line 7
21:48:04.055 - Stack End
-- This is in a server script inside the part.