I have just yet come accross the issue that, Remotefunctions just don’t work. Simple as that.
I even used the source code from Roblox Api engine. Is it just me, or my computer, or my studio?
I would really appreciate if someone would test this code out and tell me if it works for you
Check 1 prints, but check 2 doesn’t and the server doesn’t print anything aswell
Client
local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- Get reference to remote function instance
local remoteFunction = ReplicatedStorage:FindFirstChildOfClass("RemoteFunction")
-- Pass a color and position when invoking the callback
print("Check 1")
local newPart = remoteFunction:InvokeServer(Color3.fromRGB(255, 0, 0), Vector3.new(0, 0, -20))
print("Check 2")
-- Output the returned part reference
print("The server created the requested part:", newPart)
server:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- Get reference to remote function instance
local remoteFunction = ReplicatedStorage:FindFirstChildOfClass("RemoteFunction")
-- Callback function
local function createPart(player, partColor, partPosition)
print("Client fired RemoteFunction")
print(player.Name .. " requested a new part")
local newPart = Instance.new("Part")
newPart.Color = partColor
newPart.Position = partPosition
newPart.Parent = workspace
return newPart
end
-- Set function as remote function's callback
remoteFunction.OnServerInvoke = createPart