script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local player = workspace[hit.Parent.Name]
local plr = game.Players:GetPlayerFromCharacter(player)
plr.owned.nofood.Value = false
end
end)
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.

3 comments
instead of doing workspace[hit.Parent.Name] just do hit.Parent
or just delete the whole local player = ... line and just do local player = game.Players:GetPlayerFromCharacter(hit.Parent)
Thanks.