Adding to an IntValue in the workspace is not gaining effects?
Hello, hope you are well today!
I am trying to make a racing game, and here, i am trying to do each player place after winning (1st,2nd,3rd).
PlaceGet is a IntValue which tells the place the player will get after touching the winning part,and when a player touches it, it is supposed to change the player's place to its current value and the PlaceGet value gets added by 1.
The problem is that when adding it, it doesnt work very well. Its value doesnt change when i add it, it shows on the print that it changed, but not on the server (The next script is not a LocalScript type).
01 | script.Parent.Touched:Connect( function (Hit) |
03 | local Human = Hit.Parent:FindFirstChild( "Humanoid" ) |
05 | print ( "Detected human" ) |
06 | local Player = game.Players:GetPlayerFromCharacter(Hit.Parent) |
07 | if not Hit.Parent.InWinner.Value and Player ~ = nil then |
09 | local Place = workspace.PlaceGet.Value |
10 | local PlayerPlace = require(game.ServerScriptService.PlaceOfPlayers) |
11 | table.insert(PlayerPlace ,Player.Name) |
12 | Hit.Parent.InPlace.Value = Place |
13 | Hit.Parent.InWinner.Value = true |
PlayerPlace is a table, where stores in order which player won first, second, etc.
Thanks, If you need more info ask.