the script below for a loadout doesn't work in servers/studio test severs, it usually works in studio
local Weapon = ""
local Storage = game.ServerStorage
Storage:WaitForChild("Odachi")
Storage:WaitForChild("Katana")
function Odachi()
Weapon = "Odachi"
end
function Katana()
Weapon = "Katana"
end
function Deploy()
if Weapon ~= "" then
local Clone = Storage[Weapon]:Clone()
Clone.Parent = script.Parent.Parent.Parent.Parent.Backpack
game.Players.LocalPlayer.PlayerScripts:WaitForChild("CameraScript"):Destroy()
game.ServerStorage:WaitForChild("CameraScript"):Clone().Parent = game.Players.LocalPlayer.PlayerScripts
game.Players.LocalPlayer.PlayerScripts.CameraScript.Disabled = false
script.Parent.Parent:Destroy()
end
return
end
script.Parent.Odachi.MouseButton1Click:connect(Odachi)
script.Parent.Katana.MouseButton1Click:connect(Katana)
script.Parent.Deploy.MouseButton1Click:connect(Deploy)

1 comment
https://scriptinghelpers.org/guides/server-client-relationship-in-roblox