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

How do I keep the player from dying when they are moved from the Lighting?

Asked by 10 years ago

So I have a main menu script that puts the player in the lighting whenever they respawn, and when they press the play button, the script moves them back into the workspace. The problem is that the player keeps dying whenever the script puts them into the workspace. Here's my script:

Player.Character.Parent = game.Workspace Player.Character:MakeJoints()

I'm not sure what I'm doing wrong

2 answers

Log in to vote
0
Answered by
yurhomi10 192
10 years ago

I don't think you can keep a player in lighting, I could be wrong.

Ad
Log in to vote
0
Answered by
reaper5 10
10 years ago

I would try anchoring them when you move them to lighting. When you remove them from lighting, MakeJoints() and un-anchor them. --------- ^ Tried that ^ Didn't Work ^ --------- New Theory (Works just tested)

a = game.Workspace.reaper5
for i,v in pairs (a:GetChildren()) do
    if v:IsA("Part") then 
        v.Transparency = 1
        v.Anchored=true
    end
end
b = game.Workspace.BOB.Position
a:MoveTo(b)
c = game.Workspace.Spawn.Position
wait(5)
a:MoveTo(c)
for i,v in pairs (a:GetChildren()) do
    if v:IsA("Part") then
v.Transparency=0
v.Anchored=false
a.HumanoidRootPart.Transparency=1
end end

of course you can set it up for events for the textbutton and when a player is added.

Answer this question