Cannot send to server from script on NPC

Describe the bug:
Calling SendToServer from ClientInit on NPC or any underlying script causes this error:
“Cannot SendToServer to a script owned by another client”

This is very annoying, because initializing widgets on NPCs becomes very hard. I also tried to use properties, so client/server sync is not needed to be done manually, but this had no effect as well, I think widget properties are broken on NPCs as well, this maybe results of same bug or not (or maybe I made some mistake there).

How do you cause this bug?

  • Use SendToServer on NPC script or any entity underneath the NPC from ClientInit
  • expected that server receives message whenever NPC initiated on client

Which platform: PC

Which input: keyboard + mouse

Your Crayta username: strowk

Game seen in (including “Hub” or “Editor for XYZ”): Editor for Champion Bounty

How regularly do you see this? (E.g. 2/3 times - please try 3 times if possible): always

Time + date seen: 10.07.2022

Version number (found in Help tab in Settings): 0.f5.27.124757

Hiya @str !

Thank you for bringing this to our attention. I’ve gone ahead and opened up a ticket so our Internal team can take a further look into this issue for you. :slight_smile:

Hi, looks like we found a fix to make this work fine!

Notes from dev team:
"I’ve tested a widget on an NPC, and changing a property on it on the server, which works fine.

function WidgetTestScript:Init()
	self:Schedule(function()
		Wait(3)
		self:GetEntity().testWidget.properties.signTitle = Text.Format("new title")
	end)
end
1 Like