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 getting received?

Asked by 1 year ago
Edited 1 year ago
local tool = script.Parent
local detector = script.Parent.Handle.ClickDetector

local function pickup(player)
    script.Parent.Pickup:Play()
    tool.Handle.Anchored = false
    tool.Name = "Crowbar"
    tool.Parent = game.Workspace[player.Name]
    game.Workspace.BasementDoor.DoorBasement.ProximityPrompt.Enabled = true
    game.ReplicatedStorage.CrowbarText:FireClient(player)
    print("test 1")
end

detector.MouseClick:Connect(pickup)

different scripts

local textlabel = script.Parent:WaitForChild("TextLabel")

local function typewriter(object,text)
    for i = 1,#text,1 do
        object.Text = string.sub(text,1,i)
        wait(0.06)
    end
end

repeat wait(0.01) until game:IsLoaded()

wait(40)

typewriter(textlabel,"I don't have a good feeling about this place...")

wait(10)

textlabel.Text = ""

game.ReplicatedStorage.CrowbarText.OnClientEvent:Connect(function(player)
    print("working")
end)

2 answers

Log in to vote
0
Answered by 1 year ago

Remote events works between client sided scripts and server sided scripts. Using a remote for the client sided script to anotherclient sided will print nil. Try use server script instead.

Ad
Log in to vote
0
Answered by 1 year ago
Edited 1 year ago

To use an Event to pass arguments between two clients, you'll have to make use of a BindableEvent. Replace FireClient with Fire and OnClientEvent with Event.

Answer this question