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: What did i do wrong?

Previous Thread :: Next Thread 
GalenLP is not online. GalenLP
Joined: 24 Dec 2012
Total Posts: 928
14 Jan 2013 03:05 PM
Its a gun script, tried installing a system to change the positions, but i failed.

Could someone correct my error? (This is the LocalGui).

local Tool = script.Parent;

enabled = true
function onButton1Down(mouse)
if not enabled then
return
end

enabled = true
mouse.Icon = "rbxasset://textures\\GunCursor.png"

end


function onButton1Up(mouse)
enabled = false
Tool.Enabled = false
Tool.Fire2.Fire1.Enabled = false
Tool.GripForward = "-0.08219, 0.4719, 0.8778"
Tool.GripUp = "-0.9111, -0.3925, 0.1257"
mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
wait(2.2)
Tool.Fire2.Reload2:play()
wait(1)
Tool.GripForward = "-0.1994, 4.371e-008, 0.9799"
Tool.GripUp = "-8.716e-009, -1, 4.283e-008"
mouse.Icon = "rbxasset://textures\\GunCursor.png"
enabled = true
Tool.Enabled = true
end

function onEquippedLocal(mouse)

if mouse == nil then
print("Mouse not found")
return
end

mouse.Icon = "rbxasset://textures\\GunCursor.png"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
mouse.Button1Up:connect(function() onButton1Up(mouse)end)
end


Tool.Equipped:connect(onEquippedLocal)

-- Everything but Positions are correct, i think.
Report Abuse
GalenLP is not online. GalenLP
Joined: 24 Dec 2012
Total Posts: 928
14 Jan 2013 03:06 PM
I need help correcting the Tool Positions in the LocalGui, so it will work.
Report Abuse
GalenLP is not online. GalenLP
Joined: 24 Dec 2012
Total Posts: 928
14 Jan 2013 03:35 PM
Bump.
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
14 Jan 2013 03:39 PM
You shouldn't be integrating this type of thing into the script that changes the cursor. Sure, you could make it work, but what I would do is insert a whole new script (not local) and do it from there. You can then set it up like so.
Report Abuse
GalenLP is not online. GalenLP
Joined: 24 Dec 2012
Total Posts: 928
14 Jan 2013 04:18 PM
@epic: Ill try putting this as non-local, not sure if i'll work.
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