I am using RemoteEvent and it won't work.
I have this in a local script inside of StarterGui:
repeat wait() until game.Players.LocalPlayer ~= nil
repeat wait() until game.Players.LocalPlayer.Character ~= nil
game.Workspace.RemoteEvent1:FireServer(game.Players.LocalPlayer.Character)
then I have this script inside of Workspace:
local event = Instance.new("RemoteEvent")
event.Parent = game.Workspace
event.Name = "RemoteEvent1"
event.OnServerEvent:connect(function(c)
c.Humanoid.Health = 0
end)
this is the error that I get:
19:01:07.450 - Humanoid is not a valid member of Player
|