#Help
1 messages · Page 1 of 1 (latest)
Collision groups
e

what on gods green earth does that mean?
I thought I knew English, but apparently no I no kno speaker englani yes but think no to yes so change but now opposite
i think he's asking about collision groups idk
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local player = Players.LocalPlayer
local NotificationEvent = ReplicatedStorage.Remotes.Events:WaitForChild("Notification")
local Bases = workspace:WaitForChild("Bases")
local selectedSlot = nil
local selectedThing = nil
local selectedBase = nil
-- Función para configurar click en un slot
local function setupSlotClick(slot, base)
local part = slot:FindFirstChild("Spawn") -- usamos el Spawn como punto de click
if not part then return end
local clickDetector = part:FindFirstChild("ClickDetector")
if not clickDetector then
clickDetector = Instance.new("ClickDetector")
clickDetector.Parent = part
end
clickDetector.MouseClick:Connect(function()
local slotConfig = slot:FindFirstChild("Configuration")
if not slotConfig then return end
local thing = slotConfig:FindFirstChild("Thing") and slotConfig.Thing.Value
if selectedThing then
-- Ya tenemos un Thing seleccionado, intentar mover
if slotConfig.Occupied.Value then
NotificationEvent:FireClient(player, "El slot no está libre.", false)
return
end
-- Mover el Thing
selectedThing:SetPrimaryPartCFrame(slot.Spawn.CFrame)
-- Actualizar configuración
selectedSlot.Configuration.Occupied.Value = false
selectedSlot.Configuration.Thing.Value = nil
slotConfig.Occupied.Value = true
slotConfig.Thing.Value = selectedThing
NotificationEvent:FireClient(player, "Thing movida correctamente.", true)
-- Reset
selectedSlot = nil
selectedThing = nil
selectedBase = nil
else
-- Seleccionar el slot si tiene algo
if not slotConfig.Occupied.Value or not thing then
NotificationEvent:FireClient(player,
"El slot no está libre.", false)
return
end
-- Mover el Thing
selectedThing:SetPrimaryPartCFrame(slot.Spawn.CFrame)
-- Actualizar configuración
selectedSlot.Configuration.Occupied.Value = false
selectedSlot.Configuration.Thing.Value = nil
slotConfig.Occupied.Value = true
slotConfig.Thing.Value = selectedThing
NotificationEvent:FireClient(player, "Thing movida correctamente.", true)
-- Reset
selectedSlot = nil
selectedThing = nil
selectedBase = nil
else
-- Seleccionar el slot si tiene algo
if not slotConfig.Occupied.Value or not thing then
NotificationEvent:FireClient(player, "Este slot está vacío.", false)
return
end
selectedSlot = slot
selectedThing = thing
selectedBase = base
NotificationEvent:FireClient(player, "Slot seleccionado para mover. Haz click en un slot vacío.", true)
end
end)
end
-- Configurar todos los slots de todas las bases
for _, base in ipairs(Bases:GetChildren()) do
for _, slot in ipairs(base.Slots:GetChildren()) do
setupSlotClick(slot, base)
end
end
help plz
what's this im not gonna use Google translate on a script