Forum > Coding >

Execute upon respawn

Potatox

61928

Posts: 353

Threads: 25

Joined: May, 2019

Reputation: 2

Posted

How do you get a script to re-execute after you respawn?

  • 0

Hyakki
Wanting to learn Lua ; _ ;

Hyakki#0711

PoopMaster

SoundInfinity

noticed

Posts: 120

Threads: 23

Joined: Jul, 2019

Reputation: 9

Replied

function onSpawn(char) char:WaitForChild("Humanoid"2)
      -- Script
end

game:GetService("Players").LocalPlayer.CharacterAdded:Connect(onSpawn)
  • 0

Proud creator of: WRD+

Potatox

61928

Posts: 353

Threads: 25

Joined: May, 2019

Reputation: 2

Replied

@ghandy

Seems to just crash for me upon executing it w/ my script. It's most likely an issue on my end but who knows.

  • 0

Added

@PoopMaster

Thanks, working perfectly.

  • 0

Hyakki
Wanting to learn Lua ; _ ;

Hyakki#0711

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )