i mean to say that it fixed the previous error which was the stages is not a valid member of workspace but not the checkpoint error
i dont think its the leaderstats script error, i think its because the Stage script only allows the player to step on it once and only add +1 to the stages in leaderstats. It is not scripted so that it allows the players to prestige and step on it to add 1 to the stages.
I can’t see everything, but I would guess that your 1st checkpoint is called “2”, but when you prestige,
you reset stage to 0, which means you’ll never get the transition because it needs to be a difference of
1 from your first checkpoint. When you hit Prestige, try resetting the stage to 1 instead of 0 and see if
it works.
i did try that but it didnt work
Put in some print()
or warn()
calls in various points in the code to see if listeners are called and/or values are what you expect they are at various points.
Well i added warn(1) in my checkpoint script and the output is correct
and after prestige the thing changed from the first time which was- robloxapp-20200513-1215366.wmv (2.9 MB)
and now its-robloxapp-20200515-1731553.wmv (1.6 MB)
So for instance, you could have stuff like:
print("Stage value:", Stage.Value)
print("Got to Touched Listener")
print("Got to get Stage:", Stage)
etc.
Try changing print("Stage value:", Stage.Value)
to
print("Stage value -->"..Stage.Value.."<--" )
and look at the output again.
So are you saying that that continues to show 50, but what you see on the leaderboard does not?
yeah
this is the pic-
and heres the script for the prestige -
local rBtn = game.Players.LocalPlayer.PlayerGui.PrestigeGUI.rFrame.TextButton
rBtn.MouseButton1Down:Connect(function()
if game.Players.LocalPlayer.leaderstats.Stage.Value >= 50 then
wait()
game.Players.LocalPlayer.leaderstats.Stage.Value = 1
game.Players.LocalPlayer.leaderstats.Rebirths.Value = game.Players.LocalPlayer.leaderstats.Rebirths.Value + 1
end
end)
Okay, while it’s running, look at Workspace->Players->gamerboy32111
and see if you have multiple leaderstats, if you do, there’s a problem–Then look under leaderstats
and see if you have multiple Stage objects, if you do, there’s a problem.
no there is only 1 leaderstats
have a look-
In the code you just posted, I noticed you have a LocalScript attempting to change the leaderboard–
Try changing that on the server side.
idk how to do that because i am new to scripting can u help me?
Take a study of this:
A RemoteEvent
is a common way to send messages between client and server.
Once upon a time, one could do a lot more on the client side, but because of security issues,
this was tightened-up–So you’ll need to learn how to send various types of messages between the
client and server.
yeah so i have added local script in starterplayerscript as shown in the link u sent and have changed it to client-server but it still says that the stage value → 50 <—
I’m about to go to bed, but did you put a print()
in the Script
to show if the server indeed
got the message from event:FireServer()
in the LocalScript
? Your turnaround was pretty fast.
Did you create/put the RemoteEvent
somewhere such as ReplicatedStorage
in a Script
?
Did you remember to event.OnServerEvent:Connect( listenerFn )
?
If it wasn’t clear, a Script
runs on the server, a LocalScript
runs on the client.
my checkpoints were glitching so i deleted them all and i re added them but now i am getting this error Workspace.LeaderBoards:13: attempt to index nil with ‘CFrame’ and my “stages” in the leaderstats is stuck on 50 instead of 1