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: Slow-Down Gun

Previous Thread :: Next Thread 
dawgra is not online. dawgra
Joined: 31 Oct 2008
Total Posts: 9877
03 Sep 2012 12:06 PM
Hi,I'm making the "Survival Game".
I need your help.

Well,there's the "Juggernaut". I want to slown him down,with REVOLVER.
Stun - Sparkles
Jeff - BoolValue


local ToLookFor = "Humanoid" -- If you want it to damage something other than Players

function OnTouched(hit) -- When the bullet is touched...
local h = hit.Parent:findFirstChild(ToLookFor) -- find ToLookFor in the thing that was hit
if h ~= nil then -- If it is there...
if h.Jeff.Value = false then
h.Jeff.Value = true
h.WalkSpeed = 15
h.Parent.Torso.Stun.Enabled = true
script.Parent:Remove() -- remove the bullet
wait(5)
h.WalkSpeed = 20
h.Parent.Torso.Stun.Enabled = false
h.Jeff.Value = false
end

if h.Jeff.Value = true then
script.Parent:Remove() -- remove the bullet
end
end --end the if

if h == nil then -- if there is no ToLookFor in the thing that was hit....
script.Parent:Remove() -- remove the bullet
end -- end the if
end -- end the function

script.Parent.Touched:connect(OnTouched) -- Connect the OnTouched function to the bullet.
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
03 Sep 2012 12:07 PM
What seems to be the problem?

-[::ƧѡÎḾḠΰῩ::]-[::Maker of stuff and Helper of Scripting::]-
Report Abuse
dawgra is not online. dawgra
Joined: 31 Oct 2008
Total Posts: 9877
03 Sep 2012 12:08 PM
Well,IT DON'T works.
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
03 Sep 2012 12:08 PM
That's not helpful. What doesn't work about it? Is there any output?

-[::ƧѡÎḾḠΰῩ::]-[::Maker of stuff and Helper of Scripting::]-
Report Abuse
dawgra is not online. dawgra
Joined: 31 Oct 2008
Total Posts: 9877
03 Sep 2012 12:13 PM
Output... Umm...
19:12:49 - Workspace.Bullet.BulletDamage:6: 'then' expected near '='
19:12:51 - Workspace.Bullet.BulletDamage:6: 'then' expected near '='
Report Abuse
Swordphin123 is not online. Swordphin123
Joined: 09 Apr 2008
Total Posts: 5234
03 Sep 2012 12:14 PM
if h.Jeff.Value = false then

Two equal signs:

==
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
03 Sep 2012 12:16 PM
if not h.Jeff.Value then

No equal signs:


:P

(>•д•)> ¤¤ †KMXD† ¤¤ [SHG Tier~3] (^•д•^) [Freelancing Scripting Guru] <(•д•<)
Report Abuse
dawgra is not online. dawgra
Joined: 31 Oct 2008
Total Posts: 9877
03 Sep 2012 12:26 PM
19:25:31 - Script "Workspace.Bullet.BulletDamage", Line 6
19:25:31 - stack end
19:25:31 - Disconnected event because of exception
Report Abuse
dawgra is not online. dawgra
Joined: 31 Oct 2008
Total Posts: 9877
03 Sep 2012 12:30 PM
Bump?
Report Abuse
dawgra is not online. dawgra
Joined: 31 Oct 2008
Total Posts: 9877
03 Sep 2012 12:36 PM
Please.... :/
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
03 Sep 2012 12:38 PM
Well Jeff may or may not exist, so put an if statement to check for it.

(>•д•)> ¤¤ †KMXD† ¤¤ [SHG Tier~3] (^•д•^) [Freelancing Scripting Guru] <(•д•<)
Report Abuse
mamaguy is not online. mamaguy
Joined: 07 Oct 2010
Total Posts: 7073
03 Sep 2012 12:40 PM
whenever someone mentioned jeff i was just like:
I'm out q.q
Cause he scares me ._.
Report Abuse
dawgra is not online. dawgra
Joined: 31 Oct 2008
Total Posts: 9877
03 Sep 2012 12:44 PM
Modified one...

local ToLookFor = "Humanoid" -- If you want it to damage something other than Players

function OnTouched(hit) -- When the bullet is touched...
local h = hit.Parent:findFirstChild(ToLookFor) -- find ToLookFor in the thing that was hit
if h.Jeff.Value == false then
h.Jeff.Value = true
h.WalkSpeed = 15
h.Parent.Torso.Stun.Enabled = true
script.Parent:Remove() -- remove the bullet
wait(5)
h.WalkSpeed = 20
h.Parent.Torso.Stun.Enabled = false
h.Jeff.Value = false
end

if h.Jeff.Value == true or h == nil then
script.Parent:Remove() -- remove the bullet
end
end --end the if

script.Parent.Touched:connect(OnTouched) -- Connect the OnTouched function to the bullet.


19:44:04 - Script "Workspace.Bullet.BulletDamage", Line 5
19:44:04 - stack end
19:44:04 - Disconnected event because of exception
Report Abuse
dawgra is not online. dawgra
Joined: 31 Oct 2008
Total Posts: 9877
03 Sep 2012 01:11 PM
Halp.
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