Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why when I join the gui that is visible only when tool is out is visible when I join?

local plr = game.Players.LocalPlayer
local HammerGuiFake = plr.PlayerGui:WaitForChild("HammerGui")
local HammerGuiReal = HammerGuiFake:WaitForChild("FullHammerGui")
if script.Parent.Equipped
then
    HammerGuiReal.Visible = true
end

2 comments

0

Your question isn't grammatically correct, but it's because on line 3, you added an if statement. The if statement checks to see wether you've eqquiped a tool. This event only fires once because there's no loop.

0

would while true do work

1 answer

✓ Accepted answer
local plr = game.Players.LocalPlayer
local HammerGuiFake = plr.PlayerGui:WaitForChild("HammerGui")
local HammerGuiReal = HammerGuiFake:WaitForChild("FullHammerGui")

local function onChanged()
if script.Parent.Equipped then
    HammerGuiReal.Visible = true
else
    HammerGuiReal.Visible = false
end
end

script.Parent:GetPropertyChangedSignal("Equipped"):Connect(onChanged)

2 comments

0

Error " Equipped is not a valid property name."

0

Nevermind thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.