Roblox studio sending arguments correctly?

Maybe iam doing something wrong but when i send 2arguments to my module script it sends only one of them and sends the first one as the second and the first argument is nil

function LocalGUI.AddAccessory(character,accessory)
	print(character.Name)
	print(accessory.Name)
	local attachment = accessory.Handle:FindFirstChildOfClass("Attachment")

this is the module script as you ccan see it requires 2 arguments

local accessoryModel = remoteFunction:InvokeServer(v:GetAttribute("WebsiteId"))
						accessoryModel.Parent = dummy
						print(accessoryModel)
						Module:AddAccessory(dummy,accessoryModel)

this is where i use the arguments dummy = character, accessoryModel = accessory in module script
but when i print them out character = nil and accessory = dummy

Could you provide the script that receives the remote function invoke?

remoteFunction.OnServerInvoke = function(player,accessoryId)
	
	local accessoryFolder = Instance.new("Folder",workspace)
	accessoryFolder.Name = player.Name.."'s accessory folder"
	
	local accessoryModel = game:GetService("InsertService"):LoadAsset(accessoryId).MeshPartAccessory
	accessoryModel.Parent = accessoryFolder
	
	return accessoryModel
	
end

sorry here it is

1 Like

it is supposed to load the accessory in the server using insert service and then i locally set it to the dummy but i just realised something maybe i need to put the accessory folder in replicated storage :3

Are you getting any printed errors in your output/F9 Console?

yes Handle is not a valid member of Model "Workspace.Menu.Dummy from the first line in the module

fraid not i return the asset from the server invoke as the MeshPartAccessory which is an accessory class object with a handle in it

local accessoryModel = game:GetService("InsertService"):LoadAsset(accessoryId).MeshPartAccessory

Try also changing this to Module.AddAccessory(dummy,accessoryModel)

and that is not the problem here its that the arguments dont get sent over to the module correctly

1 Like

that was it big brainfart moment for me sorry

1 Like

You invoke server sending this:
remoteFunction:InvokeServer(v:GetAttribute(“WebsiteId”))
Sure v contains that Attribute?

On that function, you create a folder and parent it to the Workspace. Then create an accesoryModel and parent it into that folder.

Then you returned that accesoryModel. You now try to parent that model to “dummy”
Where u got that “dummy”?
Then sending that “dummy” and the accesory to the Module function. Does that dummy exist?

everything works now it contains everything its just alot of code thats y i only sent snippets its just that i accidentaly used a semicolon “:” instead of a dot “.”

1 Like