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 » Scripters
Home Search
 

Re: This works in Studio, but not in game

Previous Thread :: Next Thread 
TheAlaska is not online. TheAlaska
Joined: 21 Jan 2011
Total Posts: 152
20 Feb 2016 06:56 PM
bin = script.Parent
halt = false

function onButton1Down(mouse)
local hit = mouse.Target
local ThePlayer = script.Parent.Parent.Parent.Name
local Player = game.Workspace[ThePlayer]
local distance = (Player.Torso.Position-hit.Position).Magnitude

if (hit == nil) or (halt == true) then return end
halt = true
mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
bin.Ping:play()

if (hit.Name == "Sand") and
distance < 25 then
while hit.Transparency <= 1 do
hit.Transparency = hit.Transparency + 0.2
wait(0.01)
end

wait(0.01)
hit.Parent = nil
end

wait(0.05)
halt = false
mouse.Icon = "rbxasset://textures\\GunCursor.png"
end


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

bin.Selected:connect(onSelected)




Can anyone explain why?


Report Abuse
dorito9000 is not online. dorito9000
Joined: 13 Jul 2012
Total Posts: 6486
20 Feb 2016 07:08 PM
make sure it's a localscript

real men don't know they have feet
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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