Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why Wont the Tool Go Into The Player's Backpack? RemoteEvent Problem

Asked by
talist 13
3 years ago

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.

0
You used 2 different remote events! You fired "game.ReplicatedStorage.OtherEventsFunctions.HamburgerEvent", and you are asking for a Fire from "game.ReplicatedStorage.OtherEventsFunctions.BurgerTool" GGwody 0 — 3y
0
Oof, that was a problem, but not the solution :(, it still goes to the replicatedstorage instead of the players GUI, I've also changed the WorkstationImage directory to game.Players.LocalPlayer.PlayerGui.WorkStationGui.Frame.BurgerImage.HamurgerImage. talist 13 — 3y

Answer this question