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
 

why this doesnt work?

Previous Thread :: Next Thread 
boomin3 is not online. boomin3
Joined: 06 Mar 2010
Total Posts: 87
22 Feb 2013 07:49 AM
Hello so i got this script

function onDied()
c = math.random(1, 2)
if c == 1 then
wait(1)
s = game.Lighting["ShieldSword"]:Clone()
s.Parent = game.Workspace
s.Handle.Position = script.Parent.Parent.Torso.Position
end
end

script.Parent.Died:connect(onDied)
This works ^^

But this doesnt drop shieldsword. PLEASE HELP fix this script below.
function onDied()
c = math.random(1, 2, 3)
if c == 1 then
wait(1)
s = game.Lighting["ShieldSword"]:Clone()
s.Parent = game.Workspace
s.Handle.Position = script.Parent.Parent.Torso.Position
end
end

script.Parent.Died:connect(onDied)

something must be wrong with the mathrandom , please help me fix.
thanks
Report Abuse
cart6157 is not online. cart6157
Joined: 28 Feb 2009
Total Posts: 2194
22 Feb 2013 07:54 AM
Remove the line that changes the handle's position. Will help.

Usually the torso's position is like 100,100,100, so the tool will be over 100 studs away.
Report Abuse
cart6157 is not online. cart6157
Joined: 28 Feb 2009
Total Posts: 2194
22 Feb 2013 07:55 AM
And I'm assuming this script is in a Humanoid :P
Report Abuse
boomin3 is not online. boomin3
Joined: 06 Mar 2010
Total Posts: 87
22 Feb 2013 07:59 AM
it iis in humanoid, and i remove this line?
s.Handle.Position = script.Parent.Parent.Torso.Position
but i think the problem is in the random thing , because when i made it 1,2,3 from 1,2 , i killed the NPC for like 100 times and it didnt drop.
Report Abuse
boomin3 is not online. boomin3
Joined: 06 Mar 2010
Total Posts: 87
22 Feb 2013 08:31 AM
any help?
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