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: why wont this script work?

Previous Thread :: Next Thread 
callofrobloxiamw3 is not online. callofrobloxiamw3
Joined: 28 May 2011
Total Posts: 488
05 Aug 2011 11:52 PM
while true do
wait(1)
if script.Parent.Accuracy == 1 then
mouse.Icon = "http://www.roblox.com/asset/?id=58568385"
elseif script.Parent.Accuracy == 2 then
mouse.Icon = "http://www.roblox.com/asset/?id=58568391"
elseif script.Parent.Accuracy == 3 then
mouse.Icon = "http://www.roblox.com/asset/?id=58568402"
else
end
end
Report Abuse
RoAnt is not online. RoAnt
Joined: 14 Jul 2008
Total Posts: 16794
05 Aug 2011 11:55 PM
Line 9
"else"

that shouldn't be there.
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
05 Aug 2011 11:56 PM
@RoAnt
That won't break the script. The problem is that you never defined 'mouse'.
Report Abuse
callofrobloxiamw3 is not online. callofrobloxiamw3
Joined: 28 May 2011
Total Posts: 488
05 Aug 2011 11:57 PM
i removed it and it still doesnt work... btw its a script inside of a tool
Report Abuse
callofrobloxiamw3 is not online. callofrobloxiamw3
Joined: 28 May 2011
Total Posts: 488
05 Aug 2011 11:58 PM
how would i define the mouse?
Report Abuse
callofrobloxiamw3 is not online. callofrobloxiamw3
Joined: 28 May 2011
Total Posts: 488
06 Aug 2011 12:02 AM
i tried this but it didnt work either but heres the output:
Players.callofrobloxiamw3.Backpack.PaintballGun.Local Gui:4: attempt to call global 'accuracy' (a nil value)


local tool = script.Parent
while true do
wait(1)
accuracy(mouse)
end

function accuracy(mouse)
if tool.Accuracy == 1 then
mouse.Icon = "http://www.roblox.com/asset/?id=58568385"
elseif tool.Accuracy == 2 then
mouse.Icon = "http://www.roblox.com/asset/?id=58568391"
elseif tool.Accuracy == 3 then
mouse.Icon = "http://www.roblox.com/asset/?id=58568402"
end
end
Report Abuse
Roundel is not online. Roundel
Joined: 20 Mar 2010
Total Posts: 469
06 Aug 2011 12:05 AM
Tools are tricky, try this:


icons = {"58568385","58568391","58568402"}

script.Parent.Equipped:connect(function(mouse)
while true do
wait(0.5)
mouse.Icon = ("http://www.roblox.com/asset/id="..icons[script.Parent.Accuracy.Value])
end
end)
Report Abuse
callofrobloxiamw3 is not online. callofrobloxiamw3
Joined: 28 May 2011
Total Posts: 488
06 Aug 2011 12:25 AM
it still doesnt work
Report Abuse
Roundel is not online. Roundel
Joined: 20 Mar 2010
Total Posts: 469
06 Aug 2011 12:29 AM
What is Accuracy? Is it a NumberValue or what?
Report Abuse
callofrobloxiamw3 is not online. callofrobloxiamw3
Joined: 28 May 2011
Total Posts: 488
06 Aug 2011 12:33 AM
its an intvalue inside of the tool
Report Abuse
callofrobloxiamw3 is not online. callofrobloxiamw3
Joined: 28 May 2011
Total Posts: 488
06 Aug 2011 12:34 AM
its current value is 8
Report Abuse
callofrobloxiamw3 is not online. callofrobloxiamw3
Joined: 28 May 2011
Total Posts: 488
06 Aug 2011 12:35 AM
oops lol i meant 1 idk what i was thinking there
Report Abuse
lemonwonder is not online. lemonwonder
Joined: 18 Jun 2009
Total Posts: 328
06 Aug 2011 12:35 AM
while true do
wait(1)
if script.Parent.Accuracy.Value == 1 then
mouse.Icon = "http://www.roblox.com/asset/?id=58568385"
elseif script.Parent.Accuracy.Value == 2 then
mouse.Icon = "http://www.roblox.com/asset/?id=58568391"
elseif script.Parent.Accuracy.Value == 3 then
mouse.Icon = "http://www.roblox.com/asset/?id=58568402"
else
end
end
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
06 Aug 2011 12:36 AM
@lemonder
'mouse' isn't defined.

@Original Poster
Use Roundel's script, it should work fine.
Report Abuse
flappydavid is not online. flappydavid
Joined: 03 May 2009
Total Posts: 5893
06 Aug 2011 12:39 AM
Lol you guys are pathetic(besides you Spectrumw) this is so easy! I'm not even going to help! I'm just going to motivate, you can do it!
Report Abuse
lemonwonder is not online. lemonwonder
Joined: 18 Jun 2009
Total Posts: 328
06 Aug 2011 12:40 AM
@spec
this is probably a snippet of his code and mouse is probably defined somewhere
anyway, if he did define mouse, he still needs the .Values at the end of script.Parent.Accuracy
Report Abuse
callofrobloxiamw3 is not online. callofrobloxiamw3
Joined: 28 May 2011
Total Posts: 488
06 Aug 2011 12:40 AM
that partially worked lemon now it says that the mouse is a nil value agian
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
06 Aug 2011 12:40 AM
@Flappy
Roundel is very good too o: his script got no erros.
Report Abuse
lemonwonder is not online. lemonwonder
Joined: 18 Jun 2009
Total Posts: 328
06 Aug 2011 12:41 AM
okay then, mouse ISN't defined lol my mistake
anyway
what do you want mouse to be?
Report Abuse
callofrobloxiamw3 is not online. callofrobloxiamw3
Joined: 28 May 2011
Total Posts: 488
06 Aug 2011 12:42 AM
well his isnt working? im still stuck with the plain old giant mouse pointer thing and also theres no output on it though?
Report Abuse
callofrobloxiamw3 is not online. callofrobloxiamw3
Joined: 28 May 2011
Total Posts: 488
06 Aug 2011 12:53 AM
will you please just help flappydavid?
Report Abuse
Roundel is not online. Roundel
Joined: 20 Mar 2010
Total Posts: 469
06 Aug 2011 12:54 AM
Is it in a localscript?
Report Abuse
lemonwonder is not online. lemonwonder
Joined: 18 Jun 2009
Total Posts: 328
06 Aug 2011 12:55 AM
this is a tool, correct?
Report Abuse
callofrobloxiamw3 is not online. callofrobloxiamw3
Joined: 28 May 2011
Total Posts: 488
06 Aug 2011 12:55 AM
ya
Report Abuse
callofrobloxiamw3 is not online. callofrobloxiamw3
Joined: 28 May 2011
Total Posts: 488
06 Aug 2011 12:55 AM
yes to both btw since someone posted well i was
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