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

[SOLVED]Text button wont equip tool? [Filtering Enabled]

Asked by
soutpansa 120
6 years ago
Edited 6 years ago

(solved this by putting the script that clones combat into the starter pack, along with the events)

Ive got a text button that equips a tool when its clicked. it wont work for some reason. Here is a gyazo of how things are arranged.

LocalScript:

local Player = game.Players.LocalPlayer




function Give()
        script.Equip:FireServer()   
    end


script.Parent.MouseButton1Click:connect(Give)

Normal Script:

local Event = script.Parent.Equip



function Equiper(Player)
    if Player.Backpack:findFirstChild("Combat") then
    script.Parent.Parent.BackgroundColor3 = Color3.new(0,204,0)
        script.Parent.Parent.Text = "Equip"
    Player.Backpack.Combat:Remove()
    else
        script.Parent.Parent.BackgroundColor3 = Color3.new(70,0,0)
        script.Parent.Parent.Text = "Unequip"
    game.ReplicatedStorage.Combat:Clone().Parent = Player.Backpack
    end
end




Event.OnServerEvent:Connect(Equiper)

thanks for reading ^^

0
Any errors? gitrog 326 — 6y
0
use :Connect and :Destroy. :connect and :Remove are deprecated. Thundermaker300 554 — 6y
0
There's no errors at all :/ soutpansa 120 — 6y
0
I got the gui part to work, but combat will not clone to the backpack, and if I copy combat and paste it to the backpack with studio, it wont remove it when i click the gui again, but the gui changes color and text like it's suppose to .-. soutpansa 120 — 6y
0
(gui part works cause I moved it to the local script) soutpansa 120 — 6y

Answer this question