On Tool Equipped Script Not Working?

Here is the code I have.

script.Parent.Equipped:Connect(function()
if game.ReplicatedStorage.Gamevoting.VotingEnabled.Value == true and game.Players.LocalPlayer.PlayerGui.Vot.HasVoted.Value == false then
game.Players.LocalPlayer.PlayerGui.Vot.Frame.Visible = true
print(“This Worked”)
else
print(“You Have already Voted”)
end
end)

script.Parent.Unequipped:Connect(function()
script.Parent:Destroy()
end)

image
The script is located under a tool in StarterPack.

10:43:39.803 Requiring asset 5119713224.
Callstack:
Workspace.Map 1.Big War Sands Bags.Sandbags2.Sandbag.Mesh.when fired event, line 1

  • Server - when fired event:1
    10:43:40.066 :arrow_forward: Failed to load sound http://www.roblox.com/asset/?id=206374226: Unable to download sound data (x6) - Studio
    10:43:40.443 HTTP 403 (Forbidden) - Server - Script:44
    10:43:40.443 Stack Begin - Studio
    10:43:40.443 Script ‘Workspace.Map 1.Script’, Line 44 - function checkVersion - Studio - Script:44
    10:43:40.443 Script ‘Workspace.Map 1.Script’, Line 55 - Studio - Script:55
    10:43:40.443 Stack End - Studio
    10:43:40.443 HTTP 403 (Forbidden) - Server - Script:44
    10:43:40.444 Stack Begin - Studio
    10:43:40.444 Script ‘Workspace.Lobby.Script’, Line 44 - function checkVersion - Studio - Script:44
    10:43:40.444 Script ‘Workspace.Lobby.Script’, Line 55 - Studio - Script:55
    10:43:40.444 Stack End - Studio
    10:43:40.444 HTTP 403 (Forbidden) - Server - Script:44
    10:43:40.444 Stack Begin - Studio
    10:43:40.444 Script ‘Workspace.Map 1.Creepy Forest.Карта.Ландшафт.Деревья.Tree.Script’, Line 44 - function checkVersion - Studio - Script:44
    10:43:40.444 Script ‘Workspace.Map 1.Creepy Forest.Карта.Ландшафт.Деревья.Tree.Script’, Line 55 - Studio - Script:55
    10:43:40.444 Stack End - Studio
    10:43:41.022 Workspace.Map 1.Model.Model…Head. .FlashGUI.Frame.RH.Script:4: attempt to index nil with ‘findFirstChild’ - Server - Script:4
    10:43:41.022 Stack Begin - Studio
    10:43:41.022 Script ‘Workspace.Map 1.Model.Model…Head. .FlashGUI.Frame.RH.Script’, Line 4 - Studio - Script:4
    10:43:41.022 Stack End - Studio
    10:43:41.022 Workspace.Map 1.Model.Model…Head. .FlashGUI.Frame.RH.Script:4: attempt to index nil with ‘findFirstChild’ - Server - Script:4
    10:43:41.023 Stack Begin - Studio
    10:43:41.023 Script ‘Workspace.Map 1.Model.Model…Head. .FlashGUI.Frame.RH.Script’, Line 4 - Studio - Script:4
    10:43:41.023 Stack End - Studio
    10:43:41.770 :arrow_forward: Failed to load sound http://www.roblox.com/asset/?id=206374226: Unable to download sound data (x6) - Studio
    10:43:42.322 Players.LargeHotDogs13.Backpack.Voting.LocalScript:18: Expected identifier when parsing expression, got ‘)’ - Studio - LocalScript:18
    10:43:44.811 Infinite yield possible on ‘Workspace.Map 1.Model.Model.Model:WaitForChild(“Head”)’ - Studio
    10:43:44.811 Stack Begin - Studio
    10:43:44.812 Script ‘Workspace.Map 1.Model.Model.Model.Health’, Line 5 - Studio - Health:5
    10:43:44.812 Stack End - Studio
    10:43:44.812 Infinite yield possible on ‘Workspace.Map 1.Model.Model.Model:WaitForChild(“Head”)’ - Studio
    10:43:44.812 Stack Begin - Studio
    10:43:44.812 Script ‘Workspace.Map 1.Model.Model.Model.Health’, Line 5 - Studio - Health:5
    10:43:44.813 Stack End - Studio
    10:43:44.813 Infinite yield possible on ‘Workspace.Map 1.Model.Model.Model:WaitForChild(“Head”)’ - Studio
    10:43:44.813 Stack Begin - Studio
    10:43:44.813 Script ‘Workspace.Map 1.Model.Model.Model.Health’, Line 5 - Studio - Health:5
    10:43:44.813 Stack End - Studio
    10:43:44.814 Infinite yield possible on ‘Workspace.Map 1.Model.Model.Model:WaitForChild(“Head”)’ - Studio
    10:43:44.814 Stack Begin - Studio
    10:43:44.814 Script ‘Workspace.Map 1.Model.Model.Model.Health’, Line 5 - Studio - Health:5
    10:43:44.814 Stack End - Studio
    10:43:44.827 Infinite yield possible on ‘Workspace.Map 1.Model.Model.Model:WaitForChild(“Head”)’ - Studio
    10:43:44.827 Stack Begin - Studio
    10:43:44.827 Script ‘Workspace.Map 1.Model.Model.Model.Health’, Line 5 - Studio - Health:5
    10:43:44.827 Stack End - Studio
    10:43:44.828 Infinite yield possible on ‘Workspace.Map 1.Model.Model.Model:WaitForChild(“Head”)’ - Studio
    10:43:44.828 Stack Begin - Studio
    10:43:44.828 Script ‘Workspace.Map 1.Model.Model.Model.Health’, Line 5 - Studio - Health:5
    10:43:44.828 Stack End - Studio
    10:43:44.828 Infinite yield possible on ‘Players:WaitForChild(“LocalPlayer”)’ - Studio
    10:43:44.829 Stack Begin - Studio
    10:43:44.829 Script ‘Workspace.Script’, Line 2 - Studio - Script:2
    10:43:44.829 Stack End - Studio
    Here Is the Output bar.

Please help me get this to work

LargeHotDogs13

1 Like

You could clone the gui, then make the gui visible from there

wrong topic broski
try #help-and-feedback:scripting-support

I see an issue you say:

if game.ReplicatedStorage.Gamevoting.VotingEnabled == true and game.Players.LocalPlayer.PlayerGui.Vot.Vot == false then
    game.Players.LocalPlayer.PlayerGui.Vot.Frame.Visible = true
else
    print(“You Have already Voted”)
end

It should be:

if game.ReplicatedStorage.Gamevoting.VotingEnabled == true and game.Players.LocalPlayer.PlayerGui.Vot.Frame == false then
    game.Players.LocalPlayer.PlayerGui.Vot.Frame.Visible = true
else
    print(“You Have already Voted”)
end