I'm trying to do so that when you press "Join" for instance, you are put into the game and are given the tools in ServerStorage.
I tried making this script, I placed prints to check where it went wrong and it only prints the first two. The problem here is it's not replicating to the player's backpack with no errors as well.
script.Parent.MouseButton1Click:Connect(function(Player) script.Parent.Parent.Enabled = false workspace.Camera.CameraType = Enum.CameraType.Custom workspace.CurrentCamera.Blur.Enabled = false print("We're halfway theeere, WOAAAH") local Storage = game:GetService("ServerStorage") local ToolNames = {"Key-L0", "Key-L1", "Key-L2", "Key-L3", "Key-L4", "Key-L5"} local Player = game.Players.LocalPlayer if Player and Player.Character then local Tool = Storage:FindFirstChild(ToolNames) print('LEMON AND A PEARRR') if Tool then Tool:clone().Parent = Player.Backpack print('UNO DOS TRESS') end end end)
1) try changing
local Tool = Storage:FindFirstChild(ToolNames)
to...
local Tool = Storage.ToolNames
and
2) You cannot have LocalPlayer reference in a Regular Script try fetching player data using the GetPlayers service
Hopefully that works! :)