Basically I have a script to cut down a tree. Works fine and everything in studio, but when it comes to playing normally it just doesn't do a thing or even say anything in the dev console. Here is the script, if you have any idea that would be great.
local tool = script.Parent local player = tool.Parent.Parent debounce = true player:WaitForDataReady() function Collect(mouse) if mouse.Target ~= nil then if mouse.Target.Parent.Name == "Tree1" then local thetree = mouse.Target.Parent if (mouse.Target.Position - player.Character.Torso.Position).magnitude <= 20 then if thetree.Hide.Value == 0 then if debounce == true then local origwalkspeed = player.Character.Humanoid.WalkSpeed debounce = false player.Character.Humanoid.WalkSpeed = 0 local bg = Instance.new("BillboardGui") bg.Parent = player.PlayerGui bg.Adornee = player.Character.Head bg.Size = UDim2.new(4, 0, 4, 0) bg.StudsOffset = Vector3.new(0, 5, 0) local il = Instance.new("ImageLabel") il.Parent = bg il.Image = "http://www.roblox.com/asset/?id=420600020" il.Size = UDim2.new(1, 0, 1, 0) il.BackgroundTransparency = 1 wait(thetree.Time.Value) bg:remove() player.Character.Humanoid.WalkSpeed = origwalkspeed player.leaderstats.Wood.Value = player.leaderstats.Wood.Value + thetree.GiveAmount.Value debounce = true thetree.Hide.Value = 1 end end end end end end script.Parent.Selected:connect(function(mouse) mouse.Button1Down:connect(function() Collect(mouse) end) end)
I worked out I was using a HopperBin! Such an idiot. So yeah I changed it to a Tool used a Localscript and modified the script a bit to work with a Tool. But got it working! Thanks guys (: