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

Remotes Events, Unable to cast value to Object?

Asked by 2 years ago

Hello, Im quite new to Roblox lua and I was playing around with remote events.

I am trying to achieve a simple tool that allows me to print from the server to the client information.

To do that I first attempted this; (First i made the remote event on ReplicatedStorage)

  1. Make a Script on ServerScriptService
local Remote = game.ReplicatedStorage.printEvent;

function Print(p)
    Remote:FireClient(p)
end

Print('Hello from the server!!')
  1. Make the script on the PlayerScriptService (LocalScript).
local Remote = game.ReplicatedStorage.printEvent;

Remote.OnClientEvent:Connect(function(p)
    print(p)
end)

The thing is, that it doesnt print, instead it return this error:

23:45:29.179 Unable to cast value to Object - Server - Script:4

What's going on?

Answer this question