OnServerEvent Won't work somehow for unknow reason

Good Morning/Afternoon/Night fellow Roblox DevForunners people, Mine script is today again not working! Well the context behind this is that it doesnt give any Result when trying to print like it should.

I tryed of everything that i could relating to this type and I looked around the Remote Event using the print, working perfectly well. To this point i know its a bug but really don’t know if it’s the localPlayer.PlayerGui but when i tryed to print inside the function, nothing appeared so I looked down Roblox Forum, Google and Roblox Developer Site but din’t find anything so here am I creating this topic.

Here is the script reguarding where the issue is:

This is the script where the it fires the RemoteEvent with all the TableData that will be used:

-- Services 

local TweenService = game:GetService("TweenService")
local Players = game:GetService("Players")
local localplayer = Players.LocalPlayer
local ServerStorage = game:GetService("ServerStorage")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CoreGui = game:GetService("CoreGui")
local StarterGui = game:GetService("StarterGui")
local Playergui = localplayer.PlayerGui

-- MainVariables

local ScreenGui = script.Parent.Parent.Parent:WaitForChild("ScreenGui")
local GameImage = ScreenGui:WaitForChild("GameImage")
local Store = GameImage:WaitForChild("StoreBttn")
local AppearStore = GameImage:WaitForChild("StoreAppear")
local CMD = GameImage:WaitForChild("CMD")
local InRes = ReplicatedStorage:WaitForChild("WhatinThe")
local Databs = require(game:GetService("ReplicatedStorage").TableOfValues)

-- Function

TheButton.MouseButton1Click:Connect(function()
	AppearCMdlPr:Play()
	AppearStore.ScrollingEnabled = false
	InRes:FireServer(Databs["Audi Quattro Sport"], Databs["Audi Quattro Sport"]["Price"])
end)

And this is the Remote Event answer to the firing:

--Services

local TweenService = game:GetService("TweenService")
local Players = game:GetService("Players")
local ServerStorage = game:GetService("ServerStorage")
local CoreGui = game:GetService("CoreGui")
local LocalPlayers = Players.LocalPlayer

--Variables

local ScreenGui = game:GetService("StarterGui"):WaitForChild("ScreenGui")
local GameImage = ScreenGui:WaitForChild("GameImage")
local CMD = GameImage:WaitForChild("CMD")
local InRes = game:GetService("ReplicatedStorage"):WaitForChild("WhatinThe")
local Databs = require(game:GetService("ReplicatedStorage").TableOfValues)

-- InsideVariables

local PreviewCar = CMD:WaitForChild("GlobalCarPreview")
local Buy = CMD:WaitForChild("BuyBttn")
local Carname = CMD:WaitForChild("CarName")
local Carprice = CMD:WaitForChild("CarPrice")


local function xpairs(Databs)
	-- Player wants to buy certain Model
    local count -- Was going to be used to determined the Table position
	local function Whenplrclk(String, number)
		for i, v in Databs do
			print("If gone this will be printed")
			Carname.Text = tostring(String[i])
			Carprice.Text = tostring(number[v])
			return Databs
		end
	end
	return Whenplrclk
end

InRes.OnServerEvent:Connect(xpairs)

In Advance thank you and Have a good New Year!

You have a bunch of WaitForChilds between when you get the reference to the remote on the server, and when you hook up the listener. Are you sure you’re even getting to the end of the server script? Just hook it up right away.

1 Like

Your remote is firing but the GUI you’re attempting to manipulate isn’t updating because you’re referencing it in StarterGui. Since you’re using a load script you can reference it as game.Players.LocalPlayer.PlayerGui.name_of_gui

1 Like

Interesting i will look it down. Thank you!

I was trying to find that actually thank you!