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

How do I add a ForceField to a character every time it spawns?

Asked by 10 years ago

How do you Create a ForceField that will stay on your character for the rest of the time you spent in the game? I've been trying to figure this out for weeks.

-Liftin

3 answers

Log in to vote
7
Answered by 10 years ago

You simply create a new ForceField object in the character model.

This should do the trick:

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        Instance.new("ForceField", character)
    end)
end)
Ad
Log in to vote
4
Answered by
MunimR 125
10 years ago

Just apply a ForceField to the character model and it should do! So just have a script that detects when the character respawns and then add a forcefield... :)

Game:GetService"Players".PlayerAdded:connect(function(Player) 
    Player.CharacterAdded:connect(function(Character)
        Instance.new("ForceField",Character)
    end)
end)

wow 9 seconds.... really....

1
Hah. User#11893 186 — 10y
0
kay time to post somewhat productive questions for reputation MunimR 125 — 10y
Log in to vote
0
Answered by 10 years ago

Do you mean just every time or forever because you can just click the force field enable on the spawn properties. Much easier than a script.

Answer this question