#tool give script not giving

1 messages · Page 1 of 1 (latest)

wary phoenix
#

i cooked up this extremely simple server script just to make a proof of concept for my game's weapon selection system, but aint nothing happening. no errors in console and the Backpack is in fact called Backpack.

local players = game:GetService("Players")
local tool = script.tommy

players.PlayerAdded:Connect(function(plr)
    local backpack = plr:WaitForChild("Backpack")
    local clone = tool:Clone()
    clone.Parent = backpack
end)
versed basalt
#

Is the tool under the script?

wary phoenix
#

yeah

versed basalt
#

Or does It exist?

wary phoenix
#

yeah

versed basalt
wary phoenix
#

yeah

versed basalt
#

The script

#

Is it

wary phoenix
#

yeah

versed basalt
#

local Players = game:GetService("Players")
local Tool = script:WaitForChild("tommy")

Players.PlayerAdded:Connect(function(player)
local backpack = player:WaitForChild("Backpack")
local clone = Tool:Clone()
clone.Parent = backpack
end)

#

I added some prints

#

Test It and tell me the output

wary phoenix
#

i dont think you added any prints but ill just add a print rq

versed basalt
#

This Is the script:

local Players = game:GetService("Players")
local Tool = script:WaitForChild("tommy")

Players.PlayerAdded:Connect(function(player)
print(player.Name .. " joined the game")

local backpack = player:WaitForChild("Backpack")
print("Backpack found for " .. player.Name)

local clone = Tool:Clone()
clone.Parent = backpack
print("Gave tommy to " .. player.Name)

end)

versed basalt
#

Here It is

#

The script Is above

wary phoenix
#

all 3 prints worked

versed basalt
#

Does the tool giver works

runic raftBOT
#

studio** You are now Level 6! **studio

versed basalt
#

@wary phoenix does It work now

wary phoenix
autumn basin
versed basalt
#

Wait are you using clickdetector

autumn basin
#

theres a fix for that

versed basalt
#

Or like where Is the script

autumn basin
#

i cant send rn

wary phoenix
wary phoenix
versed basalt
#

OOH

autumn basin
#

try putting the script in a baseplate also restarting studio

#

maybe something is interfering

versed basalt
#

@wary phoenix

#

Is the TOOL not Part

#

Inside the script?

wary phoenix
#

yes, the tool is in the script

#

update: i put it in a touch script in a part and it worked

versed basalt
#

good

vestal cliff
#

you should use characteradded instead

#

backpack gets wiped when a new character is added so it probably gives them the tool then spawns them for the first time, deleting the tool

vocal totem
#

is tommy in fact called tommy?

#

im assuming its a tommy gun but thats not important

wary phoenix