Buy or try on script for Clothing Game

Hello! So I am making a sort of mall game where you can go throughout the stores and pick from huge selection of clothing. A feature that the game includes is that when you click on a shirt via (part detector) a gui pops up asking if you would like to try or buy the shirt. To make this work, I used a script inside of the click detector that triggers a remote function inside replicated storage. The event is called “CallUpInfo” and I was hoping to just have every shirt use the same one remote event. The event is then picked up by another script inside of StarterGUI>ScreenGUI>Frame. My problem is that every shirt will just come up with a gui of the same buy button every time. I understand that I am unable to do it that way so my solution was to make a remote event and gui for every single piece of clothing in the store. Why I am making this topic is to ask, is there a simpler way to make this happen? I feel like it would effect gameplay as well as be very time consuming if I had thousands of events and guis for each individual shirt. If thats what I have to do I will, I just want to make sure that there’s not a easier way to do it. Thanks so much.
wwdawadwda

2 Likes

So from what I can tell your trying to using one remote event for everything. You can add a value into the request

--Server
game.ReplicatedStorage.CallUpInfo.OnServerEvent:Connect(function(plr, ClothingName)
if ClothingName == "Name" then
--Do Stuff Here
end
end)
--Client
game.ReplicatedStorage.CallUpInfo:FireServer("Name")

Just make sure to put plr first or else it will not work

1 Like

I tried it and it didn’t work.

2 Likes

Oh, you got to change the script in clockdetector to a local script (I think)

2 Likes

Tried that too, sadly it didn’t work.

2 Likes

is there anyway you can send what code you have in those scripts or give me access to a game with the scripts in it?

Sure I will make a separate game really quick.

2 Likes

ManaquinTest.rbxl (47.8 KB)

1 Like

Sorry, was not checking working on it now

2 Likes
--Server Script
ClickDetector.MouseClick:Connect(function(player)
	RemoteEvent:FireClient(player, "1")
end)
--Client Script
RemoteEvent.OnClientEvent:Connect(function(Shirt)
	print(Shirt)
       if Shirt == "1" then
		--Do Stuff
	end
	script.Parent:TweenPosition(UDim2.new(0.5,0,0.5,0),"Out","Elastic",2,false)
end)
1 Like

Thank you so much for all your help, it works!

3 Likes