You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
For the remote function to pass information to the server without error -
What is the issue? Include screenshots / videos if possible!
When pressing on the button the button name is meant to be sent through a remote function but the thing is that, when the button name has a space eg: “MP Formals” it does not pass through and gives me a error “Argument 1 missing or nil”, I went through multiple tests to see what the issue is and haven’t found anything. I put the string into a table, I split it and sent those pieces individually, but it always ends up with “Argument 1 missing or nil” anytime the string has a space in it. The only string that works and actually processes is “CIC”. :InvokeServer() doesn’t have any arguments to pass through and my values don’t end up as nil so I really don’t understand
“CIC” will work and some of the others but most won’t
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve tried a lot of different things and still haven’t concluded the error
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- Local Script
for _, Button : TextButton in pairs(Outfits:GetChildren()) do
if Button:IsA("TextButton") and KitEquipDebounce == false then
Button.MouseButton1Click:Connect(function()
print(_, Button)
KitEquipDebounce = true
OutfitType = { Button.Name , Button.Text }
print(OutfitType)
local RandomChance = math.random(1, 100)
if RandomChance == 52 then
EquipSound2:Play()
else
EquipSound1:Play()
end
task.wait(KitEquipCooldownTime)
LockerEvent:InvokeServer(OutfitType)
KitEquipDebounce = false
end)
end
end
-- Server Script
LockerEvent.OnServerInvoke = function(Player, ClothingFolder : any)
local Character = Player.Character
for _, Object in pairs(Character:GetChildren()) do
if Object:IsA("Model") then
if Object.Name ~= "ODM BLAH BLAH BLAH" then
Object:Destroy()
end
end
end
print(Player, ClothingFolder)
for _, ClothingModel in pairs(game.ServerStorage.LockerSystem.FullKits:FindFirstChild(ClothingFolder[1]):GetChildren()) do
task.wait()
local LimbAttribute = ClothingModel:GetAttribute('Clothing')
local Clothing = ClothingModel:Clone()
Clothing.Parent = Character
if LimbAttribute ~= '2D' then --Make sure that the clothing is not 2d, you can not weld 2d clothing
local LimbToAttachTo = Character:FindFirstChild(LimbAttribute) --check which limb its for
Clothing.Middle.CFrame = LimbToAttachTo.CFrame --⭐
local Weld = Instance.new('ManualWeld', ClothingModel:FindFirstChild('Middle')) --find middle part of model
Weld.Part0 = LimbToAttachTo --attach main part of weld to limb
Weld.Part1 = Weld.Parent --attach secondary to middle of clothingModel
Weld.C0 = CFrame.new(0,0,0)
end
end
game.ReplicatedStorage.RefreshView:FireClient(Player)
end
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.