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

My GUI won't appear when a player dies. Please help?

Asked by 4 years ago
Edited 4 years ago

I have a GUI gun giver for a gun game and the script keeps interfering with the GUI so it does not appear when a player dies. (Yes, ResetonSpawn is enabled.)

Here is my code:

01player = script.Parent.Parent.Parent
02backpack = player.Backpack
03 
04function chooseClass(class)
05    for i, v in pairs(backpack:GetChildren()) do v:remove() end
06    for i, v in pairs(class:GetChildren()) do
07        if v:IsA("Tool") then
08            v:clone().Parent = backpack
09        elseif v:IsA("HopperBin") then
10            v:clone().Parent = backpack
11        end
12    end
13 
14    script.Parent.Main.Visible = false
15    script.Parent.Title.Visible = false
View all 25 lines...
0
Are you reciving any errors in the studio output or developer console? moo1210 587 — 4y
0
Change v:remove() into v:Destroy() and change v.MouseButton1Up:connect to v.MouseButton1Up:Connect LennyPlayzYT 269 — 4y

Answer this question