I should state that I'm not experienced with coding. Like the title says, I can't seem to get the following local script to work correctly.
local gui = script.Gui local brickClickedEvent = game.ReplicatedStorage.Events.BrickClicked local frame = script.Parent.Parent.Parent:WaitForChild('Gui').Frame local toggle = true local text = script.Parent.Parent.Parent:WaitForChild('Gui').TextButton brickClickedEvent.OnClientEvent:Connect(function() if toggle == false then frame:TweenPosition(UDim2.new(0.25, 0,0.2, 0)) text:TweenPosition(UDim2.new(0.771, 0,0.183, 0)) toggle = true else frame:TweenPosition(UDim2.new(0.25,0,1.5,0)) text:TweenPosition(UDim2.new(0.771, 0,0.183, 0)) toggle = false end end
I'm fairly certain everything else works perfectly fine considering the previous local script used to be,
local gui = script.Gui local brickClickedEvent = game.ReplicatedStorage.Events.BrickClicked brickClickedEvent.OnClientEvent:Connect(function() gui.Enabled = true end)
and this script worked perfectly, though the problem with this is the TextButton I had used to close out of the gui used a tweening script which means you couldn't reopen the gui with the brick.
Apologies for the screwed up lines, I'm not sure how to properly format the code.
Here is an imgur link to the explorer tab if it's needed.