local panelbackdoor = game.ReplicatedStorage:FindFirstChild("Panel")
local localplr = game.Players.LocalPlayer
local uis = game:GetService("UserInputService")
local forcefieldcmd = panelbackdoor and false and panelbackdoor:FireServer(
"Give Player Force Field",
"For Duration Of _",
true,
localplr,
math.huge,
{
game.GameId,
localplr.UserId,
IsForDuration = true,
Value = math.huge,
})
local forcefield = {}
local function toggleforcefield()
if forcefield[1] then
localplr.Character.Humanoid.MaxHealth = 100
localplr.Character.Humanoid.Health = 100
for _,v in forcefield do
v:Destroy()
end
table.clear(forcefield)
else
localplr.Character.Humanoid.MaxHealth = math.huge
localplr.Character.Humanoid.Health = math.huge
for _=1,8 do
table.insert(forcefield,Instance.new("ForceField",localplr.Character))
task.wait(0.3)
end
end
end
uis.InputBegan:Connect(function(input,gameprocessed)
if input.KeyCode == Enum.KeyCode.Z and not gameprocessed then
toggleforcefield()
end
end)
local gui = Instance.new("ScreenGui",localplr.PlayerGui)
gui.ResetOnSpawn = false
local button = Instance.new("TextButton",gui)
button.Size = UDim2.new(0,100,0,50)
button.Position = UDim2.new(0,0,0,0)
button.Text = "Toggle Force Field"
button.MouseButton1Click:Connect(toggleforcefield)
Comments
No comments yet
Be the first to share your thoughts!