I want a text to go up by 1 when you touch a brick. But I don't know how. Here's what I have:
local player = game.Players.LocalPlayer function Touched() player.PlayerGui.ScreenGui.TextLabel.Text = +1 end game.Players.LocalPlayer.Touched:connect(Touched)
There are two errors in that script: touches is a number value and Text has to be a string value, you can't mix them and LocalPlayer is a player, you have to connect the body parts to the function. Fix:
local player = game.Players.LocalPlayer local touches = 0 function Touched() touches = touches + 1 player.PlayerGui.ScreenGui.TextLabel.Text = tostring(touches) -- now it's a string end -- this will find the real body parts for child, index in pairs (game.Players.LocalPlayer.Character:GetChildren()) do if child:IsA("Part") then child.Touched:connect(Touched) end end