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 4 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 — 4y
0
I just need the server to get the player that fired it and not to replicate to the whole server Tayshift 6 — 4y
0
The server cannot index 1 player, you should consider using :FireClient(--your name) This only does it for a client! JesseSong 3916 — 4y
0
Alright i understand but the module i am using is on a server Tayshift 6 — 4y

2 answers

Log in to vote
0
Answered by 4 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 — 4y
0
ohh Trampyling 43 — 4y
Ad
Log in to vote
0
Answered by
raid6n 2196 Moderation Voter Community Moderator
4 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 — 4y
0
Yes, you can fire it from the server and client. raid6n 2196 — 4y
0
it appears that the bindable events arent firing Tayshift 6 — 4y

Answer this question