I have trouble trying to finish the script, or at least get to where I understand what I'm suppose to do next.
01 | local RepStorage = game:GetService( "ReplicatedStorage" ) |
02 | local Players = game:GetService( "Players" ) |
03 | local plr = Players.LocalPlayer |
04 | local playerGui = plr:WaitForChild( "PlayerGui" ) |
05 | local controlGuiClass = RepStorage:WaitForChild( "ControlsGui" ) |
06 |
07 | tool.Equipped:connect( function () |
08 | tool.rMovement.Disabled = true |
09 | tool.lMovement.Disabled = true |
10 | if plr and tool.Parent:findFirstChild( "Humanoid" ) and not controlGuiClass then |
11 | local function newControlGui() |
12 | local controlGui = controlGuiClass:Clone() --whenever i test it, it won't be placed in the PlayerGui |
13 | controlGui.Parent = playerGui |
14 | return controlGui |
15 | end |
I was told using booleans something along the lines of this:
1 | button.MouseButton 1 Click:connect( function () |
2 | frame.Visible = not frame.Visible |
3 | end ) |
Thanks,
LukeGabrieI aka EnergyBrickz
first, I have no idea what this script is, server script or local script.
If LocalScript then take a look at this script I made;
1 | local plr = game.Players.LocalPlayer |
2 | local Gui = game.ReplicatedStorage:WaitForChild( "SomeGui" ) |
3 | local tool = script.Parent |
4 |
5 | tool.Equipped:connect( function () |
6 | local NewGui = Gui:Clone() |
7 | NewGui.Parent = plr.PlayerGui |
8 | end ) |
This will clone a gui to the player gui when the tool is equipped, try adding this code on, if it helped please accept answer :D