Okay so. I want to know how I can get a local Player = but I tried everything
I have a script so I can't do local Player = game.Players.LocalPlayer. I tried to make a parameter in the function and tried game.Players:GetPlayerFromCharacter(part.Parent). But it displays:
"Workspace.Part.SurfaceGui.TextButton.Script:12: attempt to index local 'player' (a nil value)"
Here is the code:
local prog = 0
script.Parent.MouseButton1Click:connect(function(part)
prog = prog + 5
print("Cutting wood!")
script.Parent.Parent.Parent.Part.SurfaceGui.Frame.Frame.Size = UDim2.new(prog/100, 0, 1, 0)
if prog == 100 then
prog = 0
wait(.2)
script.Parent.Parent.Parent.Tree:Destroy()
script.Parent.Parent.Parent:Destroy()
end
end)
