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 4 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 — 4y

1 answer

Log in to vote
0
Answered by
stepatron 103
4 years ago
Edited 4 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 — 4y
Ad

Answer this question