You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want to make it so the error doesn’t show up in the error logs. -
What is the issue? Include screenshots / videos if possible!
“InvokeServer is not a valid member of RemoteEvent” -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve tried adding InvokeServer as a RemoteEvent into the ReplicatedStorage Folder path for it, but it still shows up the error.
Script:
local mainFrame = script.Parent:WaitForChild('Frame')
local Player = game:GetService('Players').LocalPlayer
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local Function = ReplicatedStorage:WaitForChild('Shared'):WaitForChild('Remotes'):WaitForChild('VehicleSystem')
local Dealers = workspace:WaitForChild('CarDealership'):WaitForChild('Dealers')
Dealers:WaitForChild('Raider') Dealers:WaitForChild('Providence')
local connections = {}
wait(2)
for _, typeDealer in next, Dealers:GetChildren() do
print(typeDealer.Name)
spawn(function()
local module = Function:InvokeServer({action = 'RequestInfo', type = typeDealer.Name}) -- this is the line its giving the InvokeServer Event error on
if module then
for _, dealer in next, typeDealer:GetChildren() do
print(dealer.Name)
repeat wait(0.5) print('Finding torso') until dealer:FindFirstChild('Torso')
repeat wait(0.5) until mainFrame:FindFirstChild('List')
dealer.Torso.ClickDetector.MouseClick:Connect(function()
print('Click')
for _, v in next, mainFrame.List:GetChildren() do
if v:IsA('Frame') then
v:Destroy()
end
end
print('Destroyed')
for i, v in next, module do
local price = v.dollars
local new = mainFrame.Example:Clone()
new.VehicleName.Text = tostring(i)
new.Buy.Text = 'Buy ('.. tostring(price) ..')'
new.Parent = mainFrame.List
new.Visible = true
local buyConnection buyConnection = new.Buy.MouseButton1Click:Connect(function()
local Return = Function:InvokeServer({action = 'PurchaseVehicle', vehicle = i, type = dealer.Parent.Name})
end)
end
local exitConnection exitConnection = mainFrame.Exit.MouseButton1Click:Connect(function()
mainFrame.Visible = false
exitConnection:Disconnect()
end)
mainFrame.Visible = not mainFrame.Visible
end)
end
end
end)
end
wait(1)
pcall(function()
end)
Script is in a LocalScript as the Client.