Client script :
local button = script.Parent
local queue = script.Parent.Parent.Parent.Parent.queue.queue
local createroom = game.ReplicatedStorage.createroom
local player = game:GetService("Players").LocalPlayer
local cards = button.Parent.setting.Cards.Cards
local RoomID = button.Parent.Parent.Parent.queue.queue.RoomID
button.MouseButton1Click:Connect(function()
queue.Position = UDim2.new(-1, 0, 0.178, 0)
queue.Parent.Visible = true
queue.Visible = true
button.Parent:TweenPosition(UDim2.new(-1, 0, 0.184, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.3)
queue:TweenPosition(UDim2.new(0.126, 0, 0.178, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.3)
wait(0.3)
button.Parent.Visible = false
button.Position = UDim2.new(0.025, 0, 0.184, 0)
button.Parent.Parent.Visible = false
local setting = {
cards.Value,
}
local response = createroom:InvokeServer(player, 1, setting)
print(player, 1, setting) --Output = Mek24048 1 {[1] = 10}
RoomID.Value = response[1]
end)
CLIENT OUTPUT :
Mek24048 1 ▼ {
[1] = 10
} - Client - LocalScript:22
Server script :
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local createroom = ReplicatedStorage.createroom
local ServerStorage = game:GetService("ServerStorage")
createroom.OnServerInvoke = function(player, roomType, setting)
print(player, roomType, setting) --Output should be Mek24048 1 {[1] = 10} but it Mek24048 Mek24048 1
local RoomID
local existingRooms = ServerStorage.room:GetChildren()
repeat
RoomID = math.random(1000, 9999)
until not RoomIDExists(RoomID, existingRooms)
--<ROOM>--
local newRoom = Instance.new("Folder", ServerStorage.room)
newRoom.Name = RoomID
local configuration = Instance.new("Configuration", newRoom)
if roomType == 1 then
local cards = Instance.new("IntValue", configuration)
cards.Value = setting[1]
end
local Leader = Instance.new("IntValue", newRoom)
Leader.Name = "leader"
Leader.Value = player.UserId
--<ROOM>--
local responseData = {
RoomID,
}
return responseData
end
function RoomIDExists(roomID, existingRooms)
for _, room in ipairs(existingRooms) do
if room.Name == tostring(roomID) then
return true
end
end
return false
end
SERVER OUTPUT :
Mek24048 Mek24048 1 - Server - roomCreator:6
Anyone know why???