this dig tool works 100% fine when i test in edit mode but then when i publish it, it dosnt work. I don't see whats wrong. please help. thanks
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 == "Rock") then while hit.Transparency <= 1 do hit.Transparency = hit.Transparency + 0.2 wait(0.7) end wait(0.7) hit.Parent = nil end if (hit.Name == "Dirt") then while hit.Transparency <= 1 do hit.Transparency = hit.Transparency + 0.2 wait(0.10) end wait(0.10) hit.Parent = nil end if (hit.Name == "LooseRock") then while hit.Transparency <= 1 do hit.Transparency = hit.Transparency + 0.2 wait(0.30) end wait(0.50) hit.Parent = nil end wait(0.10) 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)
Assure that you're using a LocalScript object as opposed to a server-sided Script. PlaySolo runs all scripts on the client, meaning that you need to make it run client-side in-game.