its ment to add +1 to score
script.Parent.Touched:connect(function(hit)
if hit.Parent.Name == "RedCube" or "BlueCube" then
Player.leaderstats.Score.Value = Player.leaderstats.Score.Value + 1
end
end)
Seems like you're new to lua, so in ServerScriptService make a script;
game.Players.PlayerAdded:connect(function(plr) -- when the player joins the game local leaderstats=Instance.new("Configuration") --make folder of leaderstats leaderstats.Name="leaderstats" --define the name leaderstats.Parent=plr -- sets the leaderstats in the player local score=Instance.new("NumberValue") --makes the score value score.Name="Score" -- the name score.Parent=leaderstats --sets it so you can see the score on the leaderboard end)
And in the part in the workspace, put the script;
script.Parent.Touched:connect(function(hit) -- when something touches the part if hit.Name=="Left Leg" or "Right Leg" then --if its the leg of the player local Player=game.Players:GetPlayerFromCharacter(hit.Parent) -- find the player (using the character) Player.leaderstats.Score.Value = Player.leaderstats.Score.Value + 1 -- adds the point end end)
Thanks!