Help with Point Giving System?
So this code should give somebody 25 "Points" upon touching and in order to prevent them using the block again will create a StringValue with the name of the their Character so in the future if the code sees there's a StringValue with their name it will not continue the code and not give them the points although it doesn't work.
Any help would be appreciated, thanks!
01 | game.Workspace.Yellow.Touched:connect( function (otherPart) |
02 | if (otherPart:FindFirstChild( "Humanoid" )~ = nil ) then |
03 | if (game.Workspace.Yellow:FindFirstChild(otherPart) = = nil ) then |
04 | newInstance = game.Workspace.Instance.new( "StringValue" ) |
05 | newInstance.Name = (otherPart) |
06 | local user = game.Players:GetPlayerFromCharacter(otherPart.Parent) |
07 | local stats = user:findFirstChild( "leaderstats" ) |
09 | local points = stats:findFirstChild( "Points" ) |
10 | points.Value = points.Value + 25 |