I need a script that when you click a button, the forcefield is disabled but if the button is not clicked the forcefield is not disabled!
Any help or solution!
I need a script that when you click a button, the forcefield is disabled but if the button is not clicked the forcefield is not disabled!
Any help or solution!
As @xander5610 said, you can’t just ask for full scripts here just like that. However to guide you in the right direction, here is the wiki for forcefields.
Also may I ask, are you talking about a UI button or a part with a ClickDetector
?
Like the @xander5610 said, you shouldn’t ask others for complete scripts, but I will help you out this time.
Serverscript
ClickDetector.MouseClick:Connect(function(plr)
if workspace[plr.Name]:FindFirstChild("ForceField") then
workspace[plr.Name].ForceField:Destroy()
end
end)
Use Player.Character instead of workspace[plr.Name]. There could be clones of the character around, so it’s just a precaution.
nvm i got it solved! sorry for does who helped me!