I have a GUI that lets you customize your burger, and upon clicking submit that specific burger goes into your backpack.
The GUI is cloned into the players GUI through replicated storage. I'm not sure but I think when the RemoteEvent is fired it reads off of the replicated storage GUI instead of the cloned GUI even after passing the PayerGuis variable to the RemoteEvent, ( not sure if you can do that).
So I believe the problem is it will not accept the PlayersGui variable and instead ignore it and go to the ReplicatedStorage GUI. I need help understanding <3.
Anyways here's the code :
LocalScript:
ocal SubmitButton = script.Parent local GrillGUI = script.Parent.Parent.Parent local Frame = GrillGUI.Frame local toolFolder = game.Workspace.Tools local Localplayer = game.Players.LocalPlayer local remoteEvent = game.ReplicatedStorage.OtherEventsFunctions:WaitForChild("HamburgerEvent") local WorkstationImage = script.Parent.Parent.Parent.Frame.BurgerImage.HamburgerImage SubmitButton.MouseButton1Up:Connect(function() remoteEvent:FireServer(Localplayer,WorkstationImage) Frame:TweenPosition( UDim2.new(-0.892, 0, 0.263, 0), -- End Position "Out", "Linear", 0.3, -- Time false ) wait(1.1) GrillGUI.Enabled = false script.Parent.Parent.Parent:Destroy() end)
ServerScriptStorage Script :
local remote = game.ReplicatedStorage.OtherEventsFunctions.BurgerTool local toolFolder = game.Workspace.Tools remote.OnServerEvent:Connect(function(player,Localplayer,WorkstationImage) if WorkstationImage.Image == "rbxgameasset://Images/HamburgerWithBuns (1)" then local WellDoneHamburger = toolFolder["Well-Done Hamburger"]:Clone() WellDoneHamburger.Parent = Localplayer.Backpack else print("notworking") end end)
Image:
https://imgur.com/a/IonsG89
Thanks everyone.