i just started attempting server remotes so idk whats wrong but what im trying to do is when i holddown t then the player i click on will die
server script:
local Plr = game:GetService("Players"):WaitForChild("world_kiIIer")
local remote = game:GetService("ReplicatedStorage"):WaitForChild("killplayer")
local Mouse = Plr:GetMouse()
remote.OnServerEvent:connect(function(world_kiIIer)
world_kiIIer:GetMouse().Button1Down:connect(function()
if not game:GetService("UserInputService"):IsKeyDown(Enum.KeyCode.T) then return end
if not Mouse.Target then return end
Mouse.Target.Parent.Humanoid.Health = 0
end)
end)
local script:
local repstore = game.ReplicatedStorage
local remote = repstore:WaitForChild("killplayer")
local player = game.Players:WaitForChild("world_kiIIer")
remote:FireServer(player)
my error: ServerScriptService.Script:8: attempt to index a nil value
if someone knows what im doing wrong please tell me, this is my first attempt on a serverscriptservice script

1 comment
what do u mean i should change? in my scripts