Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago
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
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. JesseSong 3916 — 4y
0
would while true do work diggerbear1 32 — 4y

1 answer

Log in to vote
0
Answered by
jetlag 15
4 years ago
Edited 4 years ago
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)
0
Error " Equipped is not a valid property name." diggerbear1 32 — 4y
0
Nevermind thanks! diggerbear1 32 — 4y
Ad

Answer this question