Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Rebirth Menu with multiple rebirth buttons?

Asked by 4 years ago

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?

0
This is not a request site, you ask questions about how to fix something not how to do something for you EiOooAxea 70 — 4y
0
Sorry :/ luxen1711 9 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

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!

0
Ill try it thanks!, luxen1711 9 — 4y
0
I dont understand how does the rebirthAmount parameter know what the amount of rebirths are? luxen1711 9 — 4y
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. Gooncreeper 98 — 4y
Ad

Answer this question