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

How can i get the player when using :FireClient?

Asked by
zmonds 7
6 years ago

I've been stuck on this and i can't find anything on the wiki

0
If you're asking 'to who to send it', a handy thing is you can actually send it to everyone using :FireAllClients() User#20388 0 — 6y

1 answer

Log in to vote
6
Answered by
Leamir 3138 Moderation Voter Community Moderator
6 years ago
Edited 6 years ago

Hello, zmonds!

On the event, you recive a parameter, the player

I found this scripts on roblox official wiki

1-- LocalScript
2 
3local ReplicatedStorage = game:GetService("ReplicatedStorage")
4local createPartEvent = ReplicatedStorage:WaitForChild("CreatePartEvent")
5 
6createPartEvent:FireServer()

. . .

01-- Script
02 
03local ReplicatedStorage = game:GetService("ReplicatedStorage")
04local createPartEvent = Instance.new("RemoteEvent", ReplicatedStorage)
05createPartEvent.Name = "CreatePartEvent"
06 
07local function onCreatePartFired(player)
08    print(player.Name, "wants to create a part")
09    local newPart = Instance.new("Part")
10    newPart.Position = Vector3.new(0, 20, 0)
11    newPart.Parent = game.Workspace
12end
13 
14createPartEvent.OnServerEvent:Connect(onCreatePartFired)

Good Luck with your games

0
This is what I would consider the best answer RiskoZoSlovenska 378 — 6y
0
Up voted! mixgingengerina10 223 — 6y
Ad

Answer this question