So hum, i was doing a little small project, and i came to a issue my remote event no work can somebody help pls.
Local:
local speficmes = “nooby!”
local player = game.Players.LocalPlayer
local UIS = game:GetService(“UserInputService”)
local rs = game:GetService(“ReplicatedStorage”)
local doit = rs:FindFirstChild(“DOIT”)
player.Chatted:Connect(function(msg)
if speficmes == msg then
doit:FireServer()
end
end)
server:
local rs = game:GetService(“ReplicatedStorage”)
local Noob = rs:WaitForChild(“Noob”)
local doit = rs:FindFirstChild(“DOIT”)
doit.OnServerEvent:Connect(function(player)
local character = player.Character
if character then
local humanoidrootpart = character:FindFirstChild("HumanoidRootPart")
if humanoidrootpart then
local findplayer = humanoidrootpart.Position
local newnoob = Noob:Clone()
newnoob.Parent = workspace
newnoob.Position = findplayer + Vector3.new(5,5,0)
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
humanoid.Health = 0
end
end
end
Can you specify your issue, and did you try debugging with prints?
Also you can make it one server script:
local speficmes = "nooby!"
local rs = game:GetService("ReplicatedStorage")
local Noob = rs:WaitForChild("Noob")
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg)
if msg == speficmes then
local character = player.Character
if character then
local humanoidrootpart = character:FindFirstChild("HumanoidRootPart")
if humanoidrootpart then
local findplayer = humanoidrootpart.Position
local newnoob = Noob:Clone()
newnoob.Parent = workspace
newnoob.Position = findplayer + Vector3.new(5,5,0)
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
humanoid.Health = 0
end
end
end
end
end)
end)
Two things;
1: Have you tried putting prints around?
2: Have you lookedi n the output window for errors? View → Output
Using the output, put prints like this!
local speficmes = “nooby!”
local player = game.Players.LocalPlayer
local UIS = game:GetService(“UserInputService”)
local rs = game:GetService(“ReplicatedStorage”)
local doit = rs:FindFirstChild(“DOIT”)
player.Chatted:Connect(function(msg)
warn("Recieved that the player chatted, checking the msg.")
if speficmes == msg then
warn("Yes the message was correct! FIRING TO SERVER.")
doit:FireServer()
end
end)
I’d recommend doing the same for the serverside to verify if it was correct.