Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is my remote event not being received?

Asked by 4 years ago

I have a bomb in replicated storage, and a remote controller in starter pack. I have a local script in the remote controller. The local script clones the bomb and places the clone in front of me when I right click. That part works properly. The same script also will fire a remote event when I left click. I have a script in the bomb. The bomb should receive the remote event and explode, but it doesn't. Why doesn't the bomb receive the remote event?

local script in the remote controller:

player = game.Players.LocalPlayer
mouse = player:GetMouse()
explosionEvent = game.ReplicatedStorage.explosionEvent

player.Backpack.Remote.Equipped:Connect(function()
    mouse.Button1Down:Connect(function()
        if player.character.Remote then
            player.Character.Remote.sphere.BrickColor = BrickColor.new("Bright green")
            player.Character.Remote.sphere.Beep:Play()
            wait(.5)
            explosionEvent:FireServer()
            player.Character.Remote.sphere.BrickColor = BrickColor.new("Bright red")
        end
    end)
    mouse.Button2Down:Connect(function()
        if player.character.Remote then
            newPart = game.ReplicatedStorage.bomb:Clone()
            newPart.Parent = game.Workspace
            newPart.playersName.Value = game.Players.LocalPlayer.Name

            playerCframe = game.Players.LocalPlayer.Character.UpperTorso.CFrame
            playerLv = playerCframe.lookVector
            newPart.bomb.CFrame = playerCframe + (playerLv * Vector3.new(5,5,5))
        end
    end)
end)

script in the bomb:

explosionEvent = game.ReplicatedStorage.explosionEvent
explosionEvent.OnServerEvent:Connect(function(player)
    if player.Name == script.Parent.playersName then
        print("AAAAAA")
    end
end)
0
what line is the error?i don't see you trying to send a remote event in your first script anywhere. dibblydubblydoo 45 — 4y
0
line 11 robertandre 35 — 4y
0
can you tell us what player.Character.Remote is? dibblydubblydoo 45 — 4y
0
the remote controller robertandre 35 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

I created the bomb on a local script, so it did not exist in the server. I had to have the bomb created in the server.

Ad

Answer this question