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

How do I remove the player's force field? [ANSWERED] [closed]

Asked by 8 years ago
Edited 8 years ago

How do I remove the player's force field without breaking when the player doesn't have a force field?

01local animation = Instance.new('Animation')
02local animTrack
03local debounce = false
04local player = game.Players.LocalPlayer.Character
05 
06function onEquip()
07   script.Parent.Handle.UnsheathSound:Play()
08end
09 
10function onActivate()
11    if not debounce then
12    debounce = true
13    player.ForceField:Destroy()
14    animation.AnimationId = "http://www.roblox.com/asset/?id=129967390"
15    animTrack = player.Humanoid:LoadAnimation(animation)
View all 33 lines...
0
Just check if he has a forcefield before you go and try to remove one. Do if player:FindFirstChild('ForceField') then player.ForceField:Destroy() end M39a9am3R 3210 — 8y
0
Thanks it works! GatitosMansion 187 — 8y
0
you don't need a script to do that 7zjh 146 — 5y

Locked by JesseSong

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
3
Answered by 8 years ago

Even though you already got your answer, a WAY easier way you could disable the Force Field without using scripts is to go to the SpawnLocation Properties and change the Force Field Duration to 0

0
Assuming you are using a spawn location Part ragingskull182 67 — 8y
0
Real useful man Tymberlejk 143 — 6y
Ad