#Slot Selections

1 messages · Page 1 of 1 (latest)

harsh cobalt
#

could someone who knows how to script come help me ts isn't working im trying to have it where if there is no data then take it to charectar creation menu which i will create but then buttons arent even working i am also trying to have a auto save

brazen gale
#

Next time show the code lol

visual mesa
harsh cobalt
#

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local checkSlotData = ReplicatedStorage:WaitForChild("CheckSlotData")
local loadSlot = ReplicatedStorage:WaitForChild("LoadSlot")

local slotFolder = script.Parent:WaitForChild("Slots")

for _, slotButton in ipairs(slotFolder:GetChildren()) do
if slotButton:IsA("TextButton") or slotButton:IsA("ImageButton") then
slotButton.MouseButton1Click:Connect(function()
local slotNumber = slotButton.Name -- "Slot1", "Slot2", etc

        -- Ask server if data exists
        local hasData = checkSlotData:InvokeServer(slotNumber)

        if hasData then
            -- Load into game
            loadSlot:FireServer(slotNumber)
        else
            -- Open character creation menu
            script.Parent.Visible = false
            game.Players.LocalPlayer.PlayerGui.MainMenu.CharacterCreation.Visible = true
        end
    end)
end

end

#

Thats the first script

#

this is the second