You can write your topic however you want, but you need to answer these questions:
-
I want to make a pet follow me, but only if it’s been bought by a user.
-
(Not needed.)
-
I’ve tried looking through multiple tutorials but they haven’t worked.
You can write your topic however you want, but you need to answer these questions:
I want to make a pet follow me, but only if it’s been bought by a user.
(Not needed.)
I’ve tried looking through multiple tutorials but they haven’t worked.
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.
No, I only have one pet that follows you.
Could you please show you’re code?
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?
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.