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

How do i make FireServer() but only for one player?

Asked by 3 years ago

Hello, I am using a module to detect the players ViewportSize. As you can only detect it on a local script.

So I need the local script to fire a remote event to the server script but it fires to all the players.

Help would be appreciated.

0
Are you indexing player variable like 'OnServerEvent:Connect(function(player)'. BestCreativeBoy 1395 — 3y
0
I just need the server to get the player that fired it and not to replicate to the whole server Tayshift 6 — 3y
0
The server cannot index 1 player, you should consider using :FireClient(--your name) This only does it for a client! JesseSong 3916 — 3y
0
Alright i understand but the module i am using is on a server Tayshift 6 — 3y

2 answers

Log in to vote
0
Answered by 3 years ago

You use FireClient() use it on a normal script then boom your done!

0
I can't as i am firing it on a local script Tayshift 6 — 3y
0
ohh Trampyling 43 — 3y
Ad
Log in to vote
0
Answered by
raid6n 2196 Moderation Voter Community Moderator
3 years ago

As the other answer said, he's right. But, if you're firing from a local script, you'll need to use bindable events.

Here's a link: https://developer.roblox.com/en-us/api-reference/class/BindableEvent

0
Can i fire a bindable event from a local script? Tayshift 6 — 3y
0
Yes, you can fire it from the server and client. raid6n 2196 — 3y
0
it appears that the bindable events arent firing Tayshift 6 — 3y

Answer this question