How would i make it so the player doesn't move when they're being changed to the survivor they selected? I know this would cause a bug as if the character loading fires slower than the round tping it'd just bring them to where the model is.
-# ill copy the servers round system over in a moment.
#Teleporting after changing character
1 messages · Page 1 of 1 (latest)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local INTER_TIME = 5
local ROUND_TIME = 10
local MIN_PLAYERS = 1
local function TpPlayers(cframe)
local players = Players:GetPlayers()
for i, player in players do
if not player.Character then continue end
player.Character:PivotTo(cframe)
end
end
local function Countdown(duration)
for i=duration, 1, -1 do
workspace:SetAttribute("Clock", i)
task.wait(1)
end
end
local function Intermission()
TpPlayers(workspace.SpawnLocation.CFrame * CFrame.new(0, 2, 0))
print("Intermission")
workspace:SetAttribute("Status", "Intermission")
Countdown(INTER_TIME)
end
local function TheGame(map)
TpPlayers(map.Spawn.CFrame)
print("Game started")
workspace:SetAttribute("Status", "Game")
Countdown(ROUND_TIME)
map:Destroy()
end
while true do
if #Players:GetPlayers() >= MIN_PLAYERS then
Intermission()
workspace:SetAttribute("Status", "Loading map")
local maps = ReplicatedStorage.Maps:GetChildren()
local ranmap = maps[math.random(#maps)]
local newmap = ranmap:Clone()
newmap.Parent = workspace
task.wait(1)
TheGame(newmap)
else
workspace:SetAttribute("Status", "Waiting for players")
print("Not enough players")
task.wait(1)
end
end```
Something i tried doing was putting the character selector script in the round system [They're in the same place; seemingly shouldn't change a thing] But it just ended up completely skipping over changing the character. Is there a reason? could i of just put it in a bad area?
Why dont instend of force changing the caracter you just clear it and apply descriptions?
I think this is better since the player will not be also force to stop moving and it can just go freely, everything can go freely without the need of re starting the chracter
This
No thats what i want. The model also contains scripts and animations; I've tried it that way and couldn't understand whats going on. I'd rather a script i can understand. Also the plaeyrs are going to be frozen for a moment when they're changed anyways. I just need to know how to get them in a certain spot without teleporting the model
sorry that was a bit of writing
I want the character to completely restart
Oh you mean
** You are now Level 4! **
yea
Oh just save the OriginalCharacter Pivot
And apply it to the new one
This way it will make it look like you didnt move and the character just changed it self
Hold on
Oh nvm looks like you already know how to use Pivots
Yea
Make sure to save the Pivot Before using the LoadCharacter()
Thanks