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

Help with died event?

Asked by 10 years ago

There is no error in the output but I know its the died event. Just do cntrl + f and type Died:connect(function()

teamcolor="Deep blue"
runteamcolor="Bright red"
lobbyteamcolor="Bright green"
required=0
timer=10
map=false
maptimer=5
mplrarr={Workspace.mplr1}
print(#mplrarr)
mplrarray = (mplrarr[math.random(1, #mplrarr)]) 
print(mplrarray)
if mplrarray==Workspace.mplr1 then
nonarray=Workspace.non1
mapchoosen="8bit map"
else
if mplrarray==Workspace.mplr2 then
nonarray=Workspace.non2
mapchoosen="Non made map"
end
end
function Start()
for Value=timer,1,-1 do
GUI.Text=("Intermision: "..Value)
wait(1)
end
if map==false then
map=true
for Value2=maptimer,1,-1 do
GUI.Text=("Map Choosen "..mapchoosen.." "..Value2)
wait(1)
end
local mplr = game.Players:GetPlayers()[math.random(1,game.Players.NumPlayers)]
mplr.TeamColor = BrickColor.new(teamcolor)
mplr.Character:WaitForChild("Torso").CFrame = mplrarray.CFrame + Vector3.new(0,5,0)
GUI.Visible=false
for i, non in pairs(game.Players:GetPlayers()) do
if non ~= mplr then
non.TeamColor = BrickColor.new(runteamcolor)
non.Character:WaitForChild("Torso").CFrame = nonarray.CFrame + Vector3.new(0,5,0)
GUI.Visible=false
mplr.Character:WaitForChild("Humanoid")Died:connect(function()
print(mplr.Name.." died")
mplr = nil
non = nil
print("Made nil")
for i,v in pairs(game.Players:GetChildren()) do
if v:IsA("Player") then
v.TeamColor = BrickColor.new(lobbyteamcolor)
v.CFrame=Workspace.SpawnLocation.CFrame + Vector3.new(0,5,0)
map=false
GUI.Visible=false
print("Finished the death")
end
end
end)
end
end
end
end
if map==true then return end
GUI=script.Parent.TextLabel
GUI.Text="Need "..required.." players to start, sir!"
GUI.Visible=true
repeat wait() until game.Players.NumPlayers>=required
Start()

1 answer

Log in to vote
1
Answered by
2eggnog 981 Moderation Voter
10 years ago

On line 41 you forgot a period.

mplr.Character:WaitForChild("Humanoid").Died:connect(function()

0
Thanks but I figured it out after sitting and staring for at least 4 hours. GetSporked 5 — 10y
Ad

Answer this question