#Flying script stops working after the character dies, but it works when they initially spawn in

1 messages · Page 1 of 1 (latest)

tight saddle
#

problem in title

#

i have a feeling its because some of the variables dont get reset when the humanoid dies but im not sure

#

but it wouldnt really make sense since the module is required each time the character respawns as the localscript that requires it is in startercharacterscripts

#

and those variables should be set to those default values upon requiring

urban pagoda
#

this is because the character you are referncing when the character dies is not the one that spawned in

#

to fix this add a event that waits untill the character is added then reruns the fly function

tight saddle
#

should i add an or player.CharacterAdded:Wait() then?

urban pagoda
#

nah add player.CharacterAdded:Connect function

tight saddle
#

alr ima try it

urban pagoda
#

like just put everything under the characteradded event

tight saddle
#

does current camera get reset on character respawn

urban pagoda
#

uhh I dont know

#

prob not

#

if u messed with the camera then it will be reset

tight saddle
#

i just fixed it by doing this because character added wasnt working

humanoid.Died:Once(function()
local clone = script:Clone()
clone.Parent = ReplicatedStorage
script:Destroy()
end)

narrow zincBOT
#

studio** You are now Level 3! **studio