I need to change points when a brick is getting touched, and then it gets deleted on the client The only problem is with changing the leaderboard. I'm new to scripting so I might do some stupid mistakes
script.Parent.Touched:Connect(function(player1)
if player1.Parent:FindFirstChild("Humanoid") then
hit = game.Players:GetPlayerFromCharacter(player1.Parent)
E = "game.Players." .. hit.Name .. ".leaderstats.Hidden.O" -- O = if the brick was touched
E.Value=1 -- Change value of O
game.ReplicatedStorage.touch:FireClient(hit)
wait(1)
end
end)
-- hidden is a folder and O is an IntValue
-- I need to somehow use E to change the value of O
When I touch the brick I get
Workspace.Partttttt.Script:7: attempt to index global 'E' (a string value)

1 comment
That was fast, thanks!