Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Class Giver GUI, Multiple Tool giver, edit?

My code:

local player = game.Players.LocalPlayer -- Refer to the Player
local tool = game.ReplicatedStorage.Sword -- Refer to the Tool
script.Parent.MouseButton1Down:connect(function() -- When it's clicked
if player:FindFirstChild("Backpack") then -- Not sure why I added this
    tool:Clone().Parent = player.Backpack -- Clone the tool to their inventory
end -- End the if function
end) -- End the MouseButton1Down function

How would I go about editing this code, to make it so that in the ReplicatedStorage, it will give more than just one tool. Like two sowrds instead of one? Or, if using guns, An AK47 and Pistol, on click of the Text Gui?

3 comments

0

Can you format your code into a code block

0

I did.

0

doesnt look like it to me. Though it could just be broken on firefox

1 answer

So you would just do

local player = game.Players.LocalPlayer -- Refer to the Player
local tool = game.ReplicatedStorage.Sword -- Refer to the Tool
local toolAnother = game.ReplicatedStorage.DifferentSword -- Refer to another tool

script.Parent.MouseButton1Down:connect(function() -- When it's clicked

if player:FindFirstChild("Backpack") then -- Not sure why I added this
tool:Clone().Parent = player.Backpack -- Clone the tool to their inventory
toolAnother:Clone().Parent = player.Backpack -- Clone another tool to their inventory
    
end -- End the if function
end) -- End the MouseButton1Down function

2 comments

1

Smh

0

Im sorry what the hell is this

This discussion is preserved as it was. New answers, comments, and votes are closed.