The output doesn’t say anything other than saying my game has a back-up file lol.
Ok, let me test out some fixes.
First thing:
if type == "Backwards" then
if plr.CurrStage.Value >= 2 then
plr.CurrStage.Value -= 1
plr.Character:SetPrimaryPartCFrame(workspace:WaitForChild("Checkpoints")["Checkpoint"+tostring(plr.CurrStage.Value)].CFrame)
end
end
The teleport should work now.
What does “Backwards” mean? I saw it in the local script too.
When you want to go forwards, you will have it be forwards. It is just for later. Did it work after you added the .CFrame?
I wasn’t able to test the teleport because the script didn’t change my leaderstats. I tried editing the script to the one below and it still didn’t work.
Event.OnServerEvent:Connect(function(plr,type)
if type == "Backwards" then
if plr.CurrStage.Value >= 2 then
plr.CurrStage.Value = plr.CurrStage.Value - 1
plr.Character:SetPrimaryPartCFrame(workspace:WaitForChild("Checkpoints")["Checkpoint"+tostring(plr.CurrStage.Value)].CFrame)
end
end
end)
I am going to sleep right now. I will respond to you tomorrow and also try to fix the code if I can. Thank you so much for your help.
it’s not supposed to yet, and it didn’t work? Did it error?
It did not error when I tested it out. I also added a print statement on the line that said “if type == “Backwards” then” and it worked but when I added a print statement on the line that said “if plr.CurrStage.Value >= 2 then” but it didn’t work.
can you write this and tell me what it prints?
local CurrStage = Instance.new("IntValue")
CurrStage.Name = "CurrStage"
CurrStage.Value = plr:WaitForChild("leaderstats"):WaitForChild("Stage").Value
print(CurrStage.Value)
Yes I will as soon as I get home thank you.
The print statement works. It printed the value of the stage that I am on.