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)
- Make a Script on ServerScriptService
local Remote = game.ReplicatedStorage.printEvent;
function Print(p)
Remote:FireClient(p)
end
Print('Hello from the server!!')
- 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?
