generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: I need help with this script

Previous Thread :: Next Thread 
iSoundFun is not online. 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 is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image