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

How can I make the player go to Lobby instead off falling out off the map and dying?

Asked by 3 years ago
Edited 3 years ago

--I used the solution from 6 Years ago. But it seems not to work anymore. Please help --The part where it meant to take the player to the map. choosemap:Destroy() for _,plr in pairs(game.Players:GetChildren()) do if plr.Backpack:FindFirstChild("Sword") then plr.Backpack.Sword:Destroy() if plr.Backpack:FindFirstChild("Handgun") then plr.Backpack.Handgun:Destroy() for i,v in pairs(game.Players:GetPlayers()) do v.Character:MoveTo(Vector3.new(game.Workspace.Spawns)) end end end end end
0
Do you have a video of what's happening? What does the output log say? radiant_Light203 1166 — 3y
0
I don't sorry. But It just wouldn't TP player like it would destroy map. Akorede09broth 9 — 3y
0
Without the output log I can't say anything conclusively. Maybe it's because some players don't have characters when the map is destroyed so the script shows an error? radiant_Light203 1166 — 3y
0
It says this :   14:59:50.565 Loading Cutscene Editor... - Studio   14:59:51.231 Infinite yield possible on 'ServerScriptService:WaitForChild("Humanoid")' - Studio   14:59:51.232 Stack Begin - Studio   14:59:51.232 Script 'ServerScriptService.Fall+Rag Death', Line 98 - Studio - Fall+Rag Death:98   14:59:51.232 Stack End - Studio   14:59:55.683 Loading Cuts Akorede09broth 9 — 3y
View all comments (2 more)
0
Also, theres no error in the script. Akorede09broth 9 — 3y
0
@radiant_Light203 Akorede09broth 9 — 3y

2 answers

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

There should be an end after line 08. Because in your script, it seems you used two if's without ending the first one.

--I used the solution from 6 Years ago. But it seems not to work anymore. Please help

--The part where it meant to take the player to the map.

    choosemap:Destroy()
    for _,plr in pairs(game.Players:GetChildren()) do
        if plr.Backpack:FindFirstChild("Sword") then
            plr.Backpack.Sword:Destroy()
        end -- here!
        if plr.Backpack:FindFirstChild("Handgun")   
            then plr.Backpack.Handgun:Destroy()
                for i,v in pairs(game.Players:GetPlayers()) do
                    v.Character:MoveTo(Vector3.new(game.Workspace.Spawns))
                end
            end
        end
    end

end

0
OOOOOOOOOH Akorede09broth 9 — 3y
0
I got rid of the "if" for handgun and added the end there. So would that work???" Akorede09broth 9 — 3y
Ad
Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

Put a part and name it Tele2:

function onTouch(part)
if part.Parent.Humanoid ~=nil then
part.Parent:MoveTo(script.Parent.Parent.Tele1.Position)
script.Parent.Parent.Tele1.Script.Disabled = true 
wait(2)
script.Parent.Parent.Tele1.Script.Disabled = false
end
end
script.Parent.Touched:connect(onTouch)

then create another and name it Tele1:

function onTouch(part)
if part.Parent.Humanoid ~=nil then
part.Parent:MoveTo(script.Parent.Parent.Tele2.Position)
script.Parent.Parent.Tele2.Script.Disabled = true 
wait(2)
script.Parent.Parent.Tele2.Script.Disabled = false
end
end
script.Parent.Touched:connect(onTouch)  

add your giver scripts and why is there a beginning indent

    choosemap:Destroy()
    for _,plr in pairs(game.Players:GetChildren()) do

Answer this question