print("Hello?")
local Players = game:GetService("Players")
local ServerStorage = game:GetService("ServerStorage")
local Folder = ServerStorage:WaitForChild("Fruits")
function AddItems(Character)
task.wait(1.2)
print(Character)
print("Adding Tools")
local Player = game.Players:GetPlayerFromCharacter(Character)
for i,v in pairs(Folder:GetChildren()) do
print("RUNNING RUNNING RUNNING RUNNING")
local Tool = v:Clone()
Tool.Parent = Player.Backpack
end
end
Players.PlayerAdded:Connect(function(player)
print("PlayerAdded!")
print("Shuold be adding tools sooon")
player.CharacterAdded:Connect(AddItems)
end)
Isn’t adding tools to my backpack after I die and respawn, and yes the “RUNNING RUNNING RUNNING” is printing in console,
I copied your code in to my studio and made some changes and it seems to work.
print("Hello?")
local Players = game:GetService("Players")
local ServerStorage = game:GetService("ServerStorage")
local Folder = ServerStorage:WaitForChild("Fruits")
function AddItems(player)
task.wait(1.2)
print("Adding Tools")
for i,v in pairs(Folder:GetChildren()) do
print("RUNNING RUNNING RUNNING RUNNING")
local tool = v:Clone()
tool.Parent = player.Backpack
end
end
Players.PlayerAdded:Connect(function(player)
print("PlayerAdded!")
print("Shuold be adding tools sooon")
player.CharacterAdded:Connect(function(character)
AddItems(player)
end)
end)
print("Hello?")
local Players = game:GetService("Players")
local ServerStorage = game:GetService("ServerStorage")
local Folder = ServerStorage:WaitForChild("Fruits")
function AddItems(Character)
task.wait(1.2)
print(Character)
print("Adding Tools")
local Player = game.Players:GetPlayerFromCharacter(Character)
for i,v in pairs(Folder:GetChildren()) do
print("RUNNING RUNNING RUNNING RUNNING")
local Tool = v:Clone()
Tool.Parent = Player.Backpack
end
end
Players.PlayerAdded:Connect(function(player)
print("PlayerAdded!")
print("Shuold be adding tools sooon")
player.CharacterAdded:Connect(function() if not player.Character then repeat wait() until player.Character; AddItems(player) end)
end)
If it doesn’t work, then reset and tell me if it works
print("Hello?")
local Players = game:GetService("Players")
local ServerStorage = game:GetService("ServerStorage")
local Folder = ServerStorage:WaitForChild("Fruits")
function AddItems(Character)
task.wait(1.2)
print(Character)
print("Adding Tools")
local Player = game.Players:GetPlayerFromCharacter(Character)
for i,v in pairs(Folder:GetChildren()) do
print("RUNNING RUNNING RUNNING RUNNING")
local Tool = v:Clone()
Tool.Parent = Player.Backpack
end
end
Players.PlayerAdded:Connect(function(player)
print("PlayerAdded!")
print("Shuold be adding tools sooon")
player.CharacterAdded:Connect(function(c) if not player.Character then repeat wait() until player.Character; AddItems(c) end)
end)