Im new to scripting and want to sell a pass that resets everyone to stage one can someone help
Just don’t create a datastore script and they will return to stage one everytime they join
This tutorial should help you with Developer Products, basically what you want to do is loop through a list of players in a for
loop and set their stage value (if youre using a folder) to 1
If you follow the tutorial, check the ProductId and insert this code
for num, player in game.Players:GetPlayers() do -- iterates through players
Ex.Value = 1 -- sets Value
player.Character:MoveTo(Location) -- put location (Teleports Players)
end
You can just do the change on the Client, and then have them spawn at the beginning, simple
Try this:
local Players = game.Players:GetChildren()
for space, plr in pairs(Players) do
local HRP = plr.Character:WaitForChild("HumanoidRootPart")
local spawn = --wherever your spawn is
HRP.Position = spawn.Position + Vector3.new(0,5,0)
end
Please let me know if this works because I’m not sure yet
This would be the script that triggers when someone already has purchased the dev product btw
Thats. basically what I said to do.
Ok, but I was giving him a script example since he said he was new to scripting
Anyway, the HRP
part is useless, can easily be swapped with Character:MoveTo
or Character:PivotTo
These are typically used for the Movement of Models (aka the players character)
Wouldn’t MoveTo
be a velocity movement towards the spawn area though?
testing it out right now. 30char