#Remote event firing without me telling it to?

1 messages · Page 1 of 1 (latest)

lost merlin
#

https://medal.tv/games/roblox-studio/clips/kP3Ndn0RZDwrpGKTb?invite=cr-MSxlbWosMzY4MjMzNTcz&v=21
There's two things that are communicating, a local script in a gui and a server script in a part with a proximity promt in it. The local script is ment to wait for the remote event to fire before sending the message in the text label at the bottom of the screen, in the clip the first thing the box says is "I am very thirsty" this is ment to happen, however right after that message the box then says "I need a glass" which it's only ment to say once the remote event has been fired using the proximity promt on the tap in the bathroom.
Local Script -

person = script.Parent.Frame.Person
TapEvent = game.ReplicatedStorage.TapEvent

main = function(dialog,time,name)
    print(dialog,time,name)
    script.Parent.Enabled = true
    dialogbox.Text = dialog
    person.Text = name
    wait(time)
    script.Parent.Enabled = false
end

main("I am very thristy",3,"You")
TapEvent.OnClientEvent:Connect(main("I need a glass", 2, "You"))```

Server Script -
```TapEvent = game.ReplicatedStorage.TapEvent

script.Parent.ProximityPrompt.Triggered:Connect(function()
    print("Event about to fire")
    TapEvent:FireAllClients()
    print("Event fired")
end)```

Watch Untitled by maowthecat and millions of other Roblox Studio videos on Medal. Tags: #robloxstudio

▶ Play video
timber trenchBOT
#

studio** You are now Level 5! **studio

frosty grove
#

Yo first, there's a problem

#

You can't connect a function that has args in it with the :connect()

#

Idk how to explain it but like you cant say

#

TapEvent.OnClientEvent:Connect(main("I need a glass", 2, "You"))

#

It has to be :

#

TapEvent.OnClientEvent:Connect(function()

   main("I need a glass", 2, "You")

end)

vale ledge
#

U probably fired it from somewhere else

lost merlin
#

ok

#

It's works now

#

Thanks