I couldn't figure out why this error occurs: 16:47:19.225 - OnCilentEvent is not a valid member of RemoteEvent
This function is listed on the Roblox Wiki and it doesn't work for me. I'm new to RemoteEvents. Am I doing a easy mistake?
-- Server Script game.Players.PlayerAdded:connect(function(player) local event = Instance.new('RemoteEvent',player) local playerName = player.Name -- more stuff event.Name = 'Dead' event:FireCilent(playerName,1,"asmiundyuay",99999999999) end) -- Cilent Script local event = game.Players.LocalPlayer:WaitForChild('Dead') event.OnCilentEvent:connect(function(typeOfPower,Profile,XP) print(Profile,XP) end)
You misspelled client, as you typed cilent. Also, you are attempting to fire this to a string, when it should be a Player instance.
Should work:
-- Server Script game.Players.PlayerAdded:connect(function(player) local event = Instance.new('RemoteEvent',player) local playerName = player.Name -- more stuff event.Name = 'Dead' event:FireClient(player,1,"asmiundyuay",99999999999) --Here you tried to fire it to a string, should be an instance player. You also misspelled Client here. end) -- Cilent Script local event = game.Players.LocalPlayer:WaitForChild('Dead') event.OnClientEvent:connect(function(typeOfPower,Profile,XP) --here you spelled client incorrectly print(Profile,XP) end)