Me and my friend are making a sword fighting game, and I'm trying to make a shop GUI and a inventory that saves. We have it so when you load into a map it gives you a class linked sword. I've looked at tutorials and the wiki and came up dry. I need to know how to make it so you can buy a knife like a dark walker for 5000 cash, then open your inventory equip it and it will load that and not the linked sword. I'm also not sure how to make the inventory save when you leave and rejoin.
Our give sword script:
local Sword = ServerStorage.Sword:Clone()
Sword.Parent = player.Backpack
local GameTag = Instance.new("BoolValue")
GameTag.Name = "GameTag"
GameTag.Parent = player.Character
else
if not player then
table.remove(plrs,i)
end
end
end
end
Lobby script:
while true do
Status.Value = "Waiting for 2 (or more) Players to Join!"
repeat wait(1) until game.Players.NumPlayers >= 2
Status.Value = "Intermission (15 seconds)"
wait(15)
local plrs = {}
for i, player in pairs (game.Players:GetPlayers())do
if player then
table.insert(plrs,player)
end
end
wait(2)
local AvailableMaps = MapsFolder:GetChildren()
local ChosenMap = AvailableMaps[math.random(1,#AvailableMaps)]
Status.Value = ChosenMap.Name.." Chosen"
local ClonedMap = ChosenMap:Clone()
ClonedMap.Parent = workspace
Teleport to map script:
local AvailableMaps = MapsFolder:GetChildren()
local ChosenMap = AvailableMaps[math.random(1,#AvailableMaps)]
Status.Value = ChosenMap.Name.." Chosen"
local ClonedMap = ChosenMap:Clone()
ClonedMap.Parent = workspace
local SpawnPoints = ClonedMap:FindFirstChild("SpawnPoints")
if not SpawnPoints then
print("SpawnPoints not found!")
end
local AvailableSpawnPoints = SpawnPoints:GetChildren()
for i, player in pairs(plrs) do
if player then
character = player.Character
if character then
character:FindFirstChild("HumanoidRootPart").CFrame = AvailableSpawnPoints[1].CFrame
table.remove(AvailableSpawnPoints,1)

2 comments
This is AlvinBlox's script, go check out his part 5 on how to make sword fight game where he makes a Shop Gui!
We do not support third party code, system or free models https://youtu.be/1MappXJ51Oo?t=244