How can I make a pet follow me only if it's been bought?

You can write your topic however you want, but you need to answer these questions:

  1. I want to make a pet follow me, but only if it’s been bought by a user.

  2. (Not needed.)

  3. I’ve tried looking through multiple tutorials but they haven’t worked.

3 Likes

Do you have the pet system in place already and how is the user selecting their pet? Is it via a GUI shop of some sorts?

If you could paste any code you have so far then someone may be able to work purchasing into it.

1 Like

No, I only have one pet that follows you.

1 Like

Could you please show you’re code?

1 Like

You could use a boolean to see if it has been bought or not then add in the code to make it follow?

I assume you’re talking about the pet script?

How would the boolean look like in the script?

A boolean is either a true or false value.

You also should provide us some code you (hopefully) have prepared.
Otherwise there is a collaboration category where you can find scripters to do your job.

Make it so it checks if the player has the pet, you would use a bool value and set it to true when its bought, and if its true, set the pets network ownership to the player.

Where should I put the bool? In the pet?

1 Like

what i mean is for example

local petBought = false

script.Parent.MouseButton1Down:Connect(function() -- whatever your doing to make it bought
    petBought = true
    if petBought = true then
          -- do something
    end
end)

Ohhh, okay. I’ll try this out.