So i want to create a rebirth menu where you could choose if you wanna rebirth 1 time, 5 times or more than that, just like clicking simulator and tapping simulator, but how do i do that with remote functions, do i have to create a remote function for each rebirth button or?
✓ ANSWER ACCEPTED
Rebirth Menu with multiple rebirth buttons?
1 answer
✓ Accepted answer
To do that you would need to have a function under ReplicatedStorage, and a script in ServerScriptService that does this,
game.ReplicatedStorage.RemoteEventName.OnServerEvent:Connect(function(plr, rebirthAmmount) --Here we are taking 2 variables, the player rebirthing and the amount of rebirths we will do.
plr.leadersats.Rebirths = plr.leadersats.Rebirths + rebirthAmmount --Just using leaderstats as a example (You can change the value of the rebirths anywhere.)
end)
Here is how you would fire the server with a local script.
game.ReplicatedStorage.RemoteEventName.FireServer(RebirthAmmount)
We do not need to put the Player inside there as it automatically sends that. Hope this was helpful!
3 comments
0
Ill try it thanks!,
0
I dont understand how does the rebirthAmount parameter know what the amount of rebirths are?
0
The local script sends over the amount of times to rebirth, it is almost like a function where you can send over parameters. It automatically sends over the player so we have to mark that but the rest we can send when firing the RemoteEvent.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
This is not a request site, you ask questions about how to fix something not how to do something for you
Sorry :/