Hello, I was building a brick(CanCollideFalse) where if you step in, a value becomes true, and if you step out, the value becomes false. The below script works perfectly in Studio Test Mode:
script.Parent.Touched:connect(function(Hit)
local Player = game.Players:GetPlayerFromCharacter(Hit.Parent)
if Player then
Player.PlayerGui.ComputerGui.Battery.change.charging.Value = true
end
end)
script.Parent.TouchEnded:connect(function(out)
local Player = game.Players:GetPlayerFromCharacter(out.Parent)
if Player then
Player.PlayerGui.ComputerGui.Battery.change.charging.Value = false
end
end)
... however fails in game with an error stating that on Line 4 and 11: ComputerGui is not a valid member of PlayerGui (when ComputerGui is clearly a child of PlayerGui.)
Maybe it's an issue with Player not being the parent of PlayerGui?
Here's a pic of my StarterGui: http://tinypic.com/r/2qceb7o/9

2 comments
Is this a localscript? Picture of your startergui?
This is a script in a part in workspace.