I know... I just asked a question yesterday... I just suck with GUIs I guess... XD
Well, whats supposed to happen is when a player touches a brick a gui from ServerStorage gets moved from there to the PlayerGui. Now the output is helping but I don't understand how to fix it.
This is what the Output says:
Workspace.trigger.Script:5: attempt to index local 'plr' (a nil value) P.S - trigger is the Script I am trying to use to move the gui's parent.
The script:
function onTouch(part)
local humanoid = part.Parent:FindFirstChild("Humanoid") --find the character
if (humanoid ~= nil) then
local plr = game.Players:GetPlayerFromCharacter(humanoid) --get the player
local playgui = plr:WaitForChild('PlayerGui') --obtains the player's PlayerGui
game.ServerStorage.profoak.Parent = playgui--the gui was in serverstorage, now moving it to the playergui
end
end
script.Parent.Touched:connect(onTouch)
Help?
