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

How can I do something to do something when a player joins?

Asked by 9 years ago

Like for example, if a person joined, they would get an ff. How can I do that?`

1 answer

Log in to vote
1
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
9 years ago

Simple. You use the PlayerAdded event. But fist, we must make a function that creates the force field.

function CreateFF(player)
    Instance.new("ForceField",player.Character) --Creates a new force field in the player's character
end

Now that we've done that, all we need to do is connect() the function to the PlayerAdded event.

function CreateFF(player)
    Instance.new("ForceField",player.Character) 
end

game.Players.PlayerAdded:connect(CreateFF)

Hope I helped!

~I went from 15 to 0 reputation for no apparent reason. If I helped you, please vote me up and accept my answer and we will both get points!~

Ad

Answer this question