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

GUI Broken? Will not spawn

Asked by 8 years ago

Well a simple weapon selection GUI. It will not work, it prints the "No spawn selected" every time I try to spawn. It gives me a weapon but will not spawn me. I've used this teleport code before so I know it would teleport me if I could figure out whats wrong here. Also no errors come up in the output. Here is the code:

local plrbck = script.Parent.Parent.Parent.Parent.Backpack
local wep = script.Parent.Parent.Weapon
local m4clone = script.Parent.Parent.Guns.M4:Clone()
local m8clone = script.Parent.Parent.Guns.Barrett:Clone()
local spawn = script.Parent.Parent.Spawnloc.Text

local function Click()

    if wep.Text == "None" then
        print("No Weapon Selected!")
    elseif wep.Text == "M4" then
        m4clone.Parent = plrbck
        if spawn == "A" then
            script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(game.Workspace.Map.spawn1.Position)
            print("PlayerSpawned")
            script.Parent.Parent:Destroy()
        elseif spawn == "None" then
            script.Parent.Parent.alert.Text = "No Spawn Selected! Please Reset and re-select."
    end
    elseif wep.Text == "M82" then
        m8clone.Parent = plrbck
        if spawn == "A" then
            script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(game.Workspace.Map.spawn1.Position)
            print("PlayerSpawned")
            script.Parent.Parent:Destroy()
        elseif spawn == "None" then
            script.Parent.Parent.alert.Text = "No Spawn Selected! Please Reset and re-select."
    end
    end
end


script.Parent.MouseButton1Down:connect(Click)


Can someone help me please? Any and all help is greatly appreciated.

0
Do I know you? did you dev for FTO? User#5978 25 — 8y
0
check to see if the value of 'spawn' is set anywhere. The error might be there. iconmaster 301 — 8y
0
I don't think so Dawn. Also Icon, spawn is declared at the top of the script. So i'm not sure i'll find a way haha CrispyBrix 113 — 8y

Answer this question