#How do I make it so when I equip a tool , a Gui pops up.

1 messages · Page 1 of 1 (latest)

frigid crater
#

How do I make it so when I equip a tool , a gui pops up?

local players = game:GetService("Players")
local player = players.LocalPlayer
local StarterGui = player:WaitForChild("StarterGui")

local CheeseBlock = script.Parent
local Cheesegui = StarterGui:WaitForChild("CheeseGui")

CheeseBlock.Equipped:Connect(function()
Cheesegui.Enabled = true
end)

CheeseBlock.Unequipped:Connect(function()
Cheesegui.Enabled = false
end)

This is my code ; this code is inside my tool "CheeseBlock" which is in replicated storage, CheeseGui is initially not set to enabled.

#

i've been trying for hours, please help me

steep forum
#

oh i made a script for this once

ebon acorn
frigid crater
ebon acorn
#

the UIs in starterGui get copied to player.PlayerGui

#

and that's the ui the player sees

steep forum
frigid crater
ebon acorn
#

yeah

frigid crater
#

local players = game:GetService("Players")
local player = players.LocalPlayer

local CheeseBlock = script.Parent

local playerGui = player:WaitForChild("PlayerGui")
local CheeseGui = playerGui:WaitForChild("CheeseGui")

CheeseBlock.Equipped:Connect(function()
CheeseGui.Enabled = true
end)

CheeseBlock.Unequipped:Connect(function()
CheeseGui.Enabled = false
end)

#

i did that but still didnt work

steep forum
#

ok so i used the player's GUI if you need you can do getservice players and use local player

#

not the startergui

#

oh u alr did that

#

mb

frigid crater
#

allg

naive stagBOT
#

studio** You are now Level 1! **studio

frigid crater
#

ive been doing tihs for an hour and still havent figured it out

steep forum
#

lemme look again

frigid crater
#

kk

steep forum
#

OHH IK I THINK

frigid crater
#

i have two scripts inside the tool so lemme see if i disable one to see if it makes the differnece

#

and it didnt

steep forum
#

when i did it it was messy but i put it in platyerscripts

#

as a local script

frigid crater
#

and did it work?

steep forum
#

yeah

naive stagBOT
#

studio** You are now Level 1! **studio

frigid crater
#

well not for me 😦

steep forum
#

but the code was so messy idk HOW it worked bc i tried it alot and i commented most of the code

#

want me to try and redo it tpo see if i can get it to work?

frigid crater
#

yes

ebon acorn
#

are there any errors?

frigid crater
#

no?

ebon acorn
#

or output

#

does it say something about infinite yield?

frigid crater
#

OMG

#

IT WORKED

#

IT WASNT A LOCAL SCRIPT

#

IT WAS THE SAME COLOUR

steep forum
#

oooohhh

frigid crater
#

BUT DIFFERENT SYMBOL

ebon acorn
#

ok

frigid crater
#

WTF

steep forum
#

lol

frigid crater
#

thanks

#

cya

steep forum
#

well atleast you got it to work

frigid crater
#

how do i close this

steep forum
#

congrats

#

idk