iSoundFun
|
  |
| Joined: 18 Jan 2014 |
| Total Posts: 53 |
|
|
| 14 Jun 2014 07:09 PM |
This script freezes and puts a force field on the player who clicks the AFK GUI button. I need your help on adding a wait time in seconds, like if the player presses the button they can still move around and walk for let's say 5 seconds then the script will come in and freeze and force field the player 5 seconds after the player clicked it. Here is the script:
function action() h=script.Parent.Parent.Parent.Parent.Character ll=h:FindFirstChild("Left Leg") ra=h:FindFirstChild("Right Arm") rl=h:FindFirstChild("Right Leg") la=h:FindFirstChild("Left Arm") he=h.Head if (h.Torso.Anchored==false) then h.Torso.Anchored=true ll.Anchored=true he.Anchored=true ra.Anchored=true la.Anchored=true rl.Anchored=true h.Humanoid.WalkSpeed=0 local ff=Instance.new("ForceField") ff.Parent=h end end script.Parent.MouseButton1Click:connect(action)
|
|
|
| Report Abuse |
|
|
alij12
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 1204 |
|
|
| 14 Jun 2014 07:10 PM |
w = 5 --Change time
function action() wait(w) h=script.Parent.Parent.Parent.Parent.Character ll=h:FindFirstChild("Left Leg") ra=h:FindFirstChild("Right Arm") rl=h:FindFirstChild("Right Leg") la=h:FindFirstChild("Left Arm") he=h.Head if (h.Torso.Anchored==false) then h.Torso.Anchored=true ll.Anchored=true he.Anchored=true ra.Anchored=true la.Anchored=true rl.Anchored=true h.Humanoid.WalkSpeed=0 local ff=Instance.new("ForceField") ff.Parent=h end end script.Parent.MouseButton1Click:connect(action) |
|
|
| Report Abuse |
|
|
Vehkter
|
  |
| Joined: 09 Mar 2014 |
| Total Posts: 152 |
|
|
| 14 Jun 2014 07:19 PM |
script.Parent.MouseButton1Click:connect(function() wait(5) --// Change time here.
local characterscript.Parent.Parent.Parent.Parent.Character local parts = { ['Left Arm'] = false, ['Right Arm'] = false, ['Left Leg'] = false, ['Right Leg'] = false, Head = false, Torso = false }
for name, value in pairs(parts) do value = character:FindFirstChild(name) or nil end
if (not (parts.Torso).Anchored) then for _, part in pairs(parts) do part.Anchored = true end
Instance.new('ForceField', character) end end) |
|
|
| Report Abuse |
|
|
cornytime
|
  |
| Joined: 07 Feb 2013 |
| Total Posts: 3213 |
|
|
| 14 Jun 2014 07:33 PM |
function action() local Plr = script.Parent.Parent.Parent.Parent.Character for i,v in pairs(script.Parent.Parent.Parent.Parent.Character:GetChildren()) do if v.className == "Part" then v.Anchored = true a = Instance.new("ForceField", Plr) end end end script.Parent.MouseButton1Click:connect(action)
idk if this works tho |
|
|
| Report Abuse |
|
|