New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

Why won't my gui go away when unequipped?[Solved]

Asked by 4 years ago

Hello! I am making a chemical thrower gear from Bioshock! I have a gui for it and I made it so when I equip the Tool it becomes visible. However it does not go away when i try this part:


local Tool = script.Parent; enabled = true function onButton1Down(mouse) if not enabled then return end enabled = false mouse.Icon = "rbxasset://textures\\GunWaitCursor.png" wait(7) mouse.Icon = "rbxassetid://207207462" enabled = true end function onEquippedLocal(mouse) game.Players.LocalPlayer.PlayerGui.ChemGui.Frame.Visible = true if mouse == nil then print("Mouse not found") return end mouse.Icon = "rbxassetid://207207462" mouse.Button1Down:connect(function() onButton1Down(mouse) end) end function Unequipped(mouse) game.Players.LocalPlayer.PlayerGui.ChemGui.Frame.Visible = false end Tool.Unequipped:connect(UnequippedLocal) --Where I have trouble Tool.Equipped:connect(onEquippedLocal)

I don't know why it is doing this but here is what is in the output: 11:24:54.168 - Attempt to connect failed: Passed value is not a function 11:24:54.169 - Script 'Players.Player1.Backpack.Flame Thrower.Local Gui', Line 34 11:24:54.170 - Stack End 11:24:56.097 - attempt to call a nil value

Any help?

~Minikitkat

0
Can I see the whole script because I have no idea what "UnequippedLocal" is. Adryin 120 — 4y
0
Yes of course minikitkat 687 — 4y
0
Edited, It is a local script and is called LocalGui minikitkat 687 — 4y

1 answer

Log in to vote
3
Answered by 4 years ago

There is no UnequippedLocal... you have Unequipped, but not the Local part.

1
Oh haha! I see what happened! Silly me. Thanks! minikitkat 687 — 4y
0
No problem! haha 0xDEADC0DE 310 — 4y
0
You should always click Accept Answer under my name on the question if it helped. Thanks :) 0xDEADC0DE 310 — 4y
Ad

Answer this question