local brick = game.Workspace.redgate.gate function onTouch(brick) player:WaitForDataReady() player:SaveString("team", "painless") game.Players:findFirstChild(brick.Parent.Name).PlayerGui.ScreenGui.TextBox.Text = player:LoadString("team") end brick.Touched:connect(onTouch)
Hello, I posted this on Scripting Helpers (forum) but had no replies. I see no reason for it to not work. It is supposed to set a datapersistance and then set the text in the GUI to the team name.
Thanks in advance, Darklaer.
UPDATE: I checked the output and saw this in it: gate is not a valid member of Script
brick = game.Workspace.redgate.gate function onTouch(hit) if hit~=nil then if game.Players:FindFirstChild(hit.Parent.Name) then local player = game.Players:FindFirstChild(hit.Parent.Name) player:WaitForDataReady() --You didn't define the player yet. player:SaveString("team", "painless") player.PlayerGui.ScreenGui.TextBox.Text = player:LoadString("team") end end end brick.Touched:connect(onTouch)
What might have been the problem was the script may have been confusing the two brick tags, as one was defined to the red gate, and another was defined to the person hitting the brick.