Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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)

2 comments

0

Just a heads up - you forgot to close off your parenthesis on the second line. ;p

0

^ thank you, fixed.

This discussion is preserved as it was. New answers, comments, and votes are closed.