Greetings,
The value is a NumberValue so it should have worked. Please help me with this error, I got no idea why it occurred. Thanks!
The error:
The code:
task.wait(3)
--Services
local players = game:GetService("Players")
local RS = game:GetService("ReplicatedStorage")
--Events
local SendGUI = RS:WaitForChild("Racing"):WaitForChild("SendGUI")
local Bindable = RS:WaitForChild("Racing"):WaitForChild("Bindable")
--Items
local Racetrack1 = script.Parent
local PlayersFolder = Racetrack1.Players
local FinishLine = Racetrack1.FinishLine
local Participants = Racetrack1.Participants
local Ongoing = Racetrack1.Ongoing
local debounce = false
local place = Racetrack1.Place
FinishLine.Touched:Connect(function(hit)
if debounce == false then
debounce = true
warn("I have received the touch")
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player and Ongoing.Value == true then
warn("I've seen that the value is true")
if players:FindFirstChild(player.Name) and PlayersFolder:FindFirstChild(player.Name) then
warn("I have found player, so both of the things are found.")
place.Value += 1 --The line where the error occurred
PlayersFolder:WaitForChild(player.Name).Value = place.Value
local otherserver = 2
Bindable:Fire(otherserver, player)
warn("I've also fired the bindable event to the script in sss, my job is done here :D")
end
end
wait(0.05)
debounce = false
end
end)