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

I want to access the player via a server script. Help?

Asked by 5 years ago
Edited 5 years ago
game.ReplicatedStorage.ModeEvents.TynReleaseEvent.OnServerEvent:Connect(function()
    local eff = game.ReplicatedStorage.ModeEffects.TynReleaseEffect:Clone()
end)

Above is the current snippet i'm dealing with, I want to make "eff"'s parent = to the player's torso.

The issue is, it's a server script, I don't know how to access the local player's torso

1 answer

Log in to vote
0
Answered by
valchip 789 Moderation Voter
5 years ago
Edited 5 years ago

When you fire the server from the client the first parameter of .OnServerEvent is the player, always.

So that would go like this:

game.ReplicatedStorage.ModeEvents.TynReleaseEvent.OnServerEvent:Connect(function(plr) print(plr.Name.." has fired this remote event.") --do other stuff here
end)

0
Just a heads up - you forgot to close off your parenthesis on the second line. ;p SummerEquinox 643 — 5y
0
^ thank you, fixed. valchip 789 — 5y
Ad

Answer this question