|
| 04 Oct 2014 09:43 AM |
This is directly in a tool, and is supposed to, when clicking a part named Pea, destroy it and give the player things. Works in studio, but in game not even the mouse icon shows up. Please help.
bin = script.Parent halt = false
function onButton1Down(mouse) local hit = mouse.Target
if (hit == nil) or (halt == true) then return end halt = true mouse.Icon = "rbxasset://textures\\GunWaitCursor.png" bin.Ping:play() if (hit.Name == "Pea") then game.Players.LocalPlayer.leaderstats.Harvest.Value = game.Players.LocalPlayer.leaderstats.Harvest.Value + 15 game.Lighting.PeaSeed:clone().Parent = script.Parent.Parent game.Lighting.PeaSeed:clone().Parent = script.Parent.Parent while hit.Part.Transparency <= 1 do hit.Part.Transparency = hit.Part.Transparency + 0.2 wait(0.01) end
wait(0.01) hit:remove() end
wait(0.05) halt = false mouse.Icon = "rbxasset://textures\\GunCursor.png" end
function onSelected(mouse) print("Action Tool Selected") mouse.Icon = "rbxasset://textures\\GunCursor.png" mouse.Button1Down:connect(function() onButton1Down(mouse) end) end
bin.Selected:connect(onSelected) |
|
|
| Report Abuse |
|
|
| |
|
|
| 04 Oct 2014 09:51 AM |
| :C Probably something with the cursor |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
|
| 04 Oct 2014 10:17 AM |
| how about putting a wait(2) in front of the entire script |
|
|
| Report Abuse |
|
|
|
| 04 Oct 2014 10:21 AM |
| Hm I tried, and it works in studio as well, but in game the mouse only changes from white to black and doesn't function. |
|
|
| Report Abuse |
|
|
| |
|
|
| 04 Oct 2014 10:24 AM |
| No that's the weird part, it works great in F6 |
|
|
| Report Abuse |
|
|
|
| 04 Oct 2014 10:24 AM |
if (hit == nil)
change it to if hit ~= nil |
|
|
| Report Abuse |
|
|
|
| 04 Oct 2014 10:28 AM |
| :\ That doesn't work either |
|
|
| Report Abuse |
|
|
|
| 04 Oct 2014 10:30 AM |
| Why dont you add prints between each line and see where it stops |
|
|
| Report Abuse |
|
|
| |
|
|
| 04 Oct 2014 10:42 AM |
Ok I got rid of the "if (hit == nil) or (halt == true) then return end" Works fine in studio but for some reason still doesn't in the game, is there a way to see script output in game? |
|
|
| Report Abuse |
|
|
|
| 04 Oct 2014 10:43 AM |
Besides F9
And any more suggestions? |
|
|
| Report Abuse |
|
|
|
| 04 Oct 2014 10:47 AM |
| anything regarding the mouse icon? |
|
|
| Report Abuse |
|
|
|
| 04 Oct 2014 10:50 AM |
| Maybe there's something different between the server and single player testing .-. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
CrowClaws
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 4466 |
|
|
| 04 Oct 2014 11:39 AM |
There is a difference between solo and server Solo everything is run on Client (local) while server things are run on both server and client. |
|
|
| Report Abuse |
|
|