My issue
I need to add a feature
the feature:
so if a player buys my gamepass he/she should get a pet while spawning as well as respawning and the pet should follow where ever the player goes
how do i script this thing?
My issue
I need to add a feature
the feature:
so if a player buys my gamepass he/she should get a pet while spawning as well as respawning and the pet should follow where ever the player goes
how do i script this thing?
Alright first off do you have code, second do you have the gamepass setup
So basically right when a player buys a gamepass you want them to spawn with a pet and then you also want them to respawn with the pet and you also want that pet to be able to follow the player?
Hey there, so first I would suggest looking into MarketplaceService for the gamepass.
You dont need a datastore for this, marketplace has a function that can tell you if the player owns the gamepass and if they do you can do whatever
https://developer.roblox.com/en-us/api-reference/function/MarketplaceService/UserOwnsGamePassAsync
Apologies for this, I hardly use marketplace.
No problem just read the api a bit more
yes of Course
and i have already setup the model of the bet and gamepass
Do you have a draft of any scripts we could help you out with?
Here I got this set up for you
So basically what Im doing is in a player added event im just checking if the player has the gamepass and if they do then blah blah
edit: this isnt the whole script, you still have to make the pet model or whatever follow the player, you can do that using bodygyro for orienting it and then bodyposition for smoothly moving it
local mps = game:GetService("MarketplaceService")
local petgamepass -- whatever
local petModelLocation -- whatever
game.Players.PlayerAdded:Connect(function(p)
local petPass = mps:UserOwnsGamePassAsync(p.UserId,petgamepass)
p.CharacterAdded:Connect(function(c)
if petPass then
-- owns pass
end
end)
end)
this can help you probably
can you please tell me what to add in petmodlelocaton?
You add where the pet is like serverstorage or replicated storage wherever you have it; also dont forget to do Clone:() at the end so that it clones for each player