Hello! So I have been having some problems with me and my friend's new survival game, and there's a problem where I need to access the player's GUI from my script (Non-local), but I need the PlayerGui folder so I have to use a local script. However, this is a full script with ALL of the important code in it.
-- Sorry if this is kinda a dumb error ¯\_( :) )_/¯
local SS = game:GetService("ServerStorage")
> local Player = game:GetService("Players").LocalPlayer
script.Parent.Touched:Connect(function(hit)
if hit.Name == "LogBreakable" then
print("Breaking...")
script.Parent["Wood Hit"]:Play()
> for i = 0,100,1 do
> wait(0.04)
> Player.PlayerGui.Breaking.side.Visible = true
> Player.PlayerGui.Breaking.side.main.Size = i
> end
print("Broke!")
script.Parent["Falling Tree Sound Effect"]:Play()
wait(1)
local logC = SS.Resources.Log:Clone()
logC.Parent = workspace
if hit.Parent ~= nil then
local pos = hit.Position
hit.Parent:Destroy()
logC.Position = pos
end
end
end)
Thanks in advance.

2 comments
I'm trying to break a tree with the axe, And its not really making the tree break. And I think that is because its trying to get the player and the log at the same time.
Nevermind I fixed it.