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

How can you detect a player with a script?

Asked by 5 years ago

I'm trying to use RocketPropulsion to create a part that follows the player around, but I don't know how to detect the player. Can someone help with this?

0
if you have their character you could use game.Players:GetPlayerFromCharacter(Character) mybituploads 304 — 5y

1 answer

Log in to vote
0
Answered by
stepatron 103
5 years ago
Edited 5 years ago
function is_player(entity)
    return typeof(entity) == "Instance" and entity.ClassName == "Player"
end
0
Currently I'm having to white list players in order for the script to work and this might work, but is there a way to use something like LocalPlayer but on a script instead? I've looked it up everywhere but can't find it. For example, like RocketPropulsion.Target = Player? DankterPepper 18 — 5y
Ad

Answer this question