|
|
Line 1: |
Line 1: |
| print("Invisibility hopper script loaded")
| | Player tools are scripts that can be run by a player. They are displayed in a box in the lower-left corner of the screen. They can be accessed by clicking their icon, or by pressing the corresponding number key. |
| | | [[Category:Tools]] |
| enabled = true
| |
| invisibilityTime = 8 -- Time the person will be invisible
| |
| reloadTime = 4 -- Additional time to reload
| |
| | |
| function setCursor(mouse)
| |
| if enabled then
| |
| mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
| |
| else
| |
| mouse.Icon = "rbxasset://textures\\ArrowFarCursor.png"
| |
| end
| |
| end
| |
| | |
| function onButton1Down(mouse)
| |
| if enabled then
| |
| enabled = false
| |
| setCursor(mouse) -- Not ready anymore
| |
| playerScript = script.Parent.Fade:clone() -- Copy the fading script
| |
| playerScript.Parent = game.Players.LocalPlayer.Character -- Place it in the player
| |
| scriptTimeOut = Instance.new("NumberValue") -- Give it a time before becoming visible again
| |
| scriptTimeOut.Name = "InvisibilityTime"
| |
| scriptTimeOut.Value = invisibilityTime
| |
| scriptTimeOut.Parent = playerScript
| |
| | |
| wait(reloadTime + invisibilityTime) -- Wait for a proper reload time
| |
| enabled = true -- Ready again
| |
| end
| |
| setCursor(mouse) -- Set apropriate cursor
| |
| end
| |
| | |
| function onSelected(mouse) -- When the weapon is selected, make the script recognize clicks
| |
| print("Invisibility selected")
| |
| setCursor(mouse) -- Make the mouse indicate readiness
| |
| mouse.Button1Down:connect(function() onButton1Down(mouse) end)
| |
| end
| |
| mouse.Icon = "Texture Path"
| |
| | |
| end
| |
Revision as of 19:04, 20 April 2007
Player tools are scripts that can be run by a player. They are displayed in a box in the lower-left corner of the screen. They can be accessed by clicking their icon, or by pressing the corresponding number key.
Pages in category "Player Tools"
The following 4 pages are in this category, out of 4 total.