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

How do I enable the forcefield?

Asked by 6 years ago
Edited 6 years ago

For instance, let's say I want to do this:

When the player equips a tool, the forcefield is enabled. And then when the player unequips the tool, it disables.

** Just to be clear, I'm talking about the blue sparkling forcefield that shows up when you initially spawn.

1 answer

Log in to vote
1
Answered by 6 years ago

This?

Tool.Equipped:connect(function()
    local forcefield = Instance.new("ForceField", game.Players.LocalPlayer.Character)
end)

Tool.Unequipped:connect(function()
    game.Players.LocalPlayer.Character.ForceField:Destroy()
end)
Ad

Answer this question