I think it’s code at this point, not the script.
Tools don’t appear. Thanks for the help though. I’ll remake it.
I’m glad I helped, good luck getting it working!
Hopefully I do manage to get it to work. Thanks once again.
Using a Script in ServerScriptService and store your tools in the ServerStorage.
local PlayerService = game:GetService("Players")
local ServerStorage = game:GetService("ServerStorage")
local StarterPack = true --If true, player will spawn with the tools located in game.ReplicatedStorage.SAE["SAE - Tools"]
local SAE = ServerStorage:WaitForChild("SAE", 30)
local ToolStorage = SAE and SAE:WaitForChild("SAE - Tools", 30)
PlayerService.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local Backpack = Player:WaitForChild("Backpack", 30)
for _, Tool in pairs(ToolStorage:GetChildren()) do
if Tool:IsA("Tool") and StarterPack == true then
Tool:Clone().Parent = Backpack
end
end
end)
end)
If you still really want to do it in client side, then here is the code, but it is not recommended.
local PlayerService = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Player = PlayerService.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait() --need to wait the first character added
local SAE = ReplicatedStorage:WaitForChild("SAE", 30)
local ToolStorage = SAE and SAE:WaitForChild("SAE - Tools", 30)
local StarterPack = true --If true, player will spawn with the tools located in game.ReplicatedStorage.SAE["SAE - Tools"]
local function AddTools()
local Backpack = Player:WaitForChild("Backpack", 30)
for _, Tool in pairs(ToolStorage:GetChildren()) do
if Tool:IsA("Tool") and StarterPack == true then
Tool:Clone().Parent = Backpack
end
end
end
AddTools()--first time tool adding
Player.CharacterAdded:Connect(AddTools)--Respawn tool adding