#help with gravity coil gamepass

1 messages · Page 1 of 1 (latest)

summer gale
#

Ok first of all why not use a remote event

#

And you can check if a user owns a gamepass

#

Not if the purchase is finished

#

That’s useless for your script rn

opal olive
#

could you help at all?

summer gale
#

yeah just give me a little i can rewrite it and help you

opal olive
#

tysm i appreciate it

#

this is my explorer structure too

#

i think once the gravity coil is done, would i be able to just change the product id for somethjing else like a speed coil and magic carpet or wtvr?

summer gale
#

yes

#

you can just copy and paste it prob

#

i just gotta test this thing

#

So,

#

when you press the button

#

does the gamepass prompt pop up

opal olive
#

yes

summer gale
#

ok

#

first of all

#

can you make a folder in replicated storage called Events for me

#

because thats what im making in the script

opal olive
#

Yes, i just did

#

ty

summer gale
#

3ok

#

now

#

in the folder

#

make a remote event

#

call it 'GamepassBuy'

#

without those brackets ofc

opal olive
#

i have indeed done that too

summer gale
#

Okay so thats where you will store most of your remote events

#

if you dont have them in there now its fine but for later it makes it easier to find

opal olive
#

i haven't really touched on remotevents yet so i dont have anything to put in there lol

summer gale
#

all good

#

Okay

#

--local script

local player = game.Players.LocalPlayer
local mps = game:GetService("MarketplaceService")
local passId = 1632594322
local events = game.ReplicatedStorage:WaitForChild("Events")

script.Parent.MouseButton1Click:Connect(function()
    mps:PromptGamePassPurchase(player, passId)
    if mps.PromptGamePassPurchaseFinished(player.UserId,passId) then
        events.GamepassBuy:FireServer(true,player)
    end
end)

--server script

local events = game.ReplicatedStorage:WaitForChild("Events")
local Tool = script.Parent.Parent.ServerStorage.GravityCoil

events.GamepassBuy.OnServerEvent:Connect(function(value,player)
    if value == true then
        local char = player.Character  
        local ToolClone = Tool:Clone()
        ToolClone.Parent = char.Backpack
    
    end
end)```
#

do that

#

so change the server script to the script that says server script and the local script to the script that says local script

#

and if it doesnt work i think i know why but it should be fine

#

im adding the playeradded thing now btw

opal olive
#

this pops up on when you click the button

summer gale
#

hm

#

is it a product

#

or a gamepass

#

it needs to be a gamepass

#

thats why i chjanged it

opal olive
#

how do i get the gamepass id? I got the asset id, didnt really work, but then i uploaded it to developer products and use the product id

summer gale
#

yes

#

wait

#

is this a one time thing

#

or a perm thing

opal olive
#

is what a one time thing?

summer gale
#

the coil

#

like is it permanent or is it for one time

#

also brb i have to eat lunch

opal olive
#

i'm not sure on how to check, and yeah that's fine dw, take ur time

summer gale
#

back

#

what is ur game

opal olive
#

its an obby

summer gale
#

oh

#

ok

#

well

#

do you want the player to always have the item

#

or just until they leave the game or die

opal olive
#

i think it might be better to let them have it when they leave or die

summer gale
#

you think itll be better or you know

#

its your choice

#

it just means when they rejoin they wont have it

#

obbys normally have it delete when you leave or die which is fine but it would be best to make it cheaper then

opal olive
#

it'd be better for them to have it if they left or not

#

yeah its not expensive at all

summer gale
#

so if they die

#

or leave and rejoin

#

you want it gone?

opal olive
#

if they die or leave, i want it to stay with them

#

for when they join back

#

if thats possible

summer gale
#

it is

#

alr

#

first off

#

you need to make it a gamepass

#

instead of a product

#

products can be purchased more than once

#

gamepasses cant which makes them perm

opal olive
#

is it the asset id that i need to use then?

summer gale
#

no

#

you need to make it a gamepass

#

just make a gamepass

opal olive
#

ive made gamepasses but idk how to properly get the gamepass ids

#

without asset ids

summer gale
#

thats what it is

#

the asset id is the gamepass id

#

but u made a product

opal olive
#

ohhh i see

summer gale
#

not a gamepass

#

so the script wont make it

#

work*

opal olive
#

yeah i saved them just incase

#

ill send it over

summer gale
#

alright

opal olive
#

247206424

#

is the asset id

summer gale
#

for which

#

or for what

#

the grav coil right

opal olive
#

247206424 is the asset id for the gravity coil

summer gale
#

alright

#

im coding the fusion coil too

#

if you dont mind

opal olive
#

i think thegamepasses are speed coil and magic carpet for the rest

#

if thats alright

#

i dont wanna overload u with anything

summer gale
#

if you want me to make it i can make it

#

cus im halfway done making it i just need the id lol

#

it takes like 45 secs to make

opal olive
#

ohhhh thank you, ill send the rest now

#

247206697 - speed coil

#

247207087 - magic carpet

summer gale
#

alr

#

im inputing them rn

#

just gotta make more scripts

#

just copying and pasting

opal olive
#

tysm i really do appreciate it

summer gale
#

its not much but glad it helps

#

apparently its big

#

but i tell you what to do and stuff

#

try to tell me if it works or not

#

i can fix

#

it prob wont work cus im not the best but i can fix it

opal olive
#

where do i put the gravity coil model aswell?

summer gale
#

server storage

#

put them all in there

#

with the names- 'GravityCoil','SpeedCoil' and 'MagicCarpet'

opal olive
#

do i make a seperate script for them all or put it in the same one

summer gale
#

seperate

opal olive
#

even the server script?

summer gale
#

the sever script goes in server script storage

#

so where it says server script

#

put that whole thing in a server script in sss

opal olive
summer gale
#

ok gimmi a sec

#

so

#

the gravity coil

#

its probally a gamepass

#

not

#

a gamepass

#

the other 2 must be

opal olive
#

oh yeah oops

#

my bad

#

yeah the purchase is working on all but doesn't appear in my inv

summer gale
#

ok

#

give me like

#

1 sec

#

i suck at backpacks

#

thats why

opal olive
#

that's fine dw about it

summer gale
#

so

#

in the script

#

on the server

#

do you see where it says char.backpack and c.backpack

#

or just this

#

it should be player.Backpack

#

not c.Backpack or char.Backpack

#

i think

#

yes

opal olive
#

okay yeah ill have a look

summer gale
#

alr

opal olive
#

also, is this supposed to bne like this?

#

oh oops

#

wrong thing

#

that was the speed coil gamepass mb

summer gale
#

lol its fine

opal olive
#

i replaced them all with player.Backpack and still doesn't appear

summer gale
#

hm

#

let me try

opal olive
#

could it be the coils themselves?

summer gale
#

i cant nvm lol

#

lets see

#

i mean

#

maybe?

#

do a print

#

for all of the purchases going through on the client

#

like print("Purchased") in each of the things

opal olive
summer gale
#
    local char = player.Character  
    if itemBuying == "GravityCoil" then
        local ToolClone = Tool:Clone()
        ToolClone.Parent = player.Backpack
    elseif itemBuying == "SpeedCoil" then
        local Clone = Tool2:Clone()
        Clone.Parent = player.Backpack
    elseif itemBuying == "MagicCarpet" then
        local clone = tool3:Clone()
        clone.Parent = player.Backpack
    end
end)```
#

not there

#

here

#

right after each then

#

put that print

opal olive
#

like this?

summer gale
#

yes

#

now test

#

and make sure output is on

opal olive
#

i dont think its appearing

summer gale
#

is output on?

opal olive
#

output is on yeah

summer gale
#

send one of the local scripts

opal olive
#

from the imagebutton?

summer gale
#

yeh

opal olive
#
local player = game.Players.LocalPlayer
local mps = game:GetService("MarketplaceService")
local passId = 247206424
local events = game.ReplicatedStorage:WaitForChild("Events")

script.Parent.MouseButton1Click:Connect(function()
    mps:PromptGamePassPurchase(player, passId)
    if mps.PromptGamePassPurchaseFinished(player.UserId,passId) then
        events.GamepassBuy:FireServer(true,player)
    end
end)```
summer gale
#

yeah

#

ok

#

i made an updated one

summer gale
#

copy this whole script

#

and paste into the locations

opal olive
#

okay yeah ive done that

summer gale
#

now test

opal olive
#

okay its still not appearing

#

surely its got to be something on my end thats wrong

summer gale
#

no idea

#

did you change all of the

#

them

#

to the new ones

#

because you had the old ones

opal olive
#
local player = game.Players.LocalPlayer
local mps = game:GetService("MarketplaceService")
local passId = 247206424  
local events = game.ReplicatedStorage:WaitForChild("Events")
local itemBuying = "GravityCoil"

script.Parent.MouseButton1Click:Connect(function()
    mps:PromptGamePassPurchase(player, passId)
    if mps.PromptGamePassPurchaseFinished(player.UserId,passId) then
        events.GamepassBuy:FireServer(player,passId,itemBuying)
    end
end)

local player = game.Players.LocalPlayer
local mps = game:GetService("MarketplaceService")
local passId = 247207087  
local events = game.ReplicatedStorage:WaitForChild("Events")
local itemBuying = "MagicCarpet"

script.Parent.MouseButton1Click:Connect(function()
    mps:PromptGamePassPurchase(player, passId)
    if mps.PromptGamePassPurchaseFinished(player.UserId,passId) then
        events.GamepassBuy:FireServer(player,passId,itemBuying)
    end
end)

local player = game.Players.LocalPlayer
local mps = game:GetService("MarketplaceService")
local passId = 247206697 
local events = game.ReplicatedStorage:WaitForChild("Events")
local itemBuying = "SpeedCoil"

script.Parent.MouseButton1Click:Connect(function()
    mps:PromptGamePassPurchase(player, passId)
    if mps.PromptGamePassPurchaseFinished(player.UserId,passId) then
        events.GamepassBuy:FireServer(player,passId,itemBuying)
    end
end)```
#

these?

summer gale
#

yeah but its not 1 script

#

its 3 seperate ones

opal olive
#

yeah ik i just put them together here to make it easier

summer gale
#

alr

#

try to put a print

#

right when the remote event is rcieved

#

recieved

opal olive
#

events.GamepassBuy:FireServer(player,passId,itemBuying)
print("Remote Received")

#

like this?

summer gale
#

ye

#

but not there

opal olive
#

also is there a way i can remove most of the things that appear in the output so i can see the prints easier 😭

summer gale
#

on the serevr script

#

what else did you print

opal olive
#

if itemBuying == "GravityCoil" then
local ToolClone = Tool:Clone()
ToolClone.Parent = player.Backpack
print("purchased")
elseif itemBuying == "SpeedCoil" then
local Clone = Tool2:Clone()
Clone.Parent = player.Backpack
print("purchased")
elseif itemBuying == "MagicCarpet" then
local clone = tool3:Clone()
clone.Parent = player.Backpack
print("purchased")

summer gale
#

yes above that

#

above the first if

#

print there

opal olive
#

should i put the prints that already exist above it?

summer gale
#

no

opal olive
#

print("magic carpet")
elseif itemBuying == "MagicCarpet" then
local clone = tool3:Clone()
clone.Parent = player.Backpack
print("purchased")

#

like this?

summer gale
#

no

#

above all the ifs

#

and elseifs

#

right after the remote is recieved

opal olive
#

local char = player.Character
print("remote received server")
if itemBuying == "GravityCoil" then

#

im guessing there

#

above them all

summer gale
#

yeah

#

it works there

opal olive
#

okay

summer gale
#

try to see if it prints

opal olive
#

this is what appaear

#

s

summer gale
#

hm

#

ok

#

so

#

isnt it an image button

opal olive
#

yeah

summer gale
#

why is the script in workspace

#

i mean if it works it works

opal olive
#

accidentally had another model in

summer gale
#

ok

#

make sure

#

its in an image button

opal olive
#

the scripts?

summer gale
#

yeah they are right

opal olive
#

yeahyeah

summer gale
#

click right after that error

#

local script 9

#

whats the line

opal olive
#

im clickign and its not sending me anywhere

summer gale
#

ok

#

send that script

#

local script 9

#

its the magic carpet 1

#

send thqat

opal olive
#

local player = game.Players.LocalPlayer
local mps = game:GetService("MarketplaceService")
local passId = 247207087
local events = game.ReplicatedStorage:WaitForChild("Events")
local itemBuying = "MagicCarpet"

script.Parent.MouseButton1Click:Connect(function()
mps:PromptGamePassPurchase(player, passId)
if mps.PromptGamePassPurchaseFinished(player.UserId,passId) then
events.GamepassBuy:FireServer(player,passId,itemBuying)
print("Remote Received")
end
end)

summer gale
#

ok delete the remote recieved

#

wait

#

dont

#

does it print that when you click

opal olive
#

i dont see anything

summer gale
#

but it prompts you right

opal olive
#

yeah

summer gale
#

ok put the print right above the remote event fire

#

in that magic carpit script

opal olive
#

Players.JayKPS.PlayerGui.PopUps.ImageLabel.GravBtn.LocalScript:9: attempt to call a RBXScriptSignal value - Client - LocalScript:9

#

if mps.PromptGamePassPurchaseFinished(player.UserId,passId) then

summer gale
#

its that line

#

wait

#

i got it

opal olive
#

oh?

summer gale
#

give me a lil

#

i gotta fix it

#

oopsies

#

try that

#

i dont think you should make it save

#

its hard to test that

#

and it takes a while

#

norm obbys dont

#
--local script for grav coil

local player = game.Players.LocalPlayer
local mps = game:GetService("MarketplaceService")
local passId = 247206424  
local events = game.ReplicatedStorage:WaitForChild("Events")
local itemBuying = "GravityCoil"

script.Parent.MouseButton1Click:Connect(function()
    mps:PromptGamePassPurchase(player, passId)
        events.GamepassBuy:FireServer(player,passId,itemBuying)
end)


-- local script for speed coil
local player = game.Players.LocalPlayer
local mps = game:GetService("MarketplaceService")
local passId = 247206697 
local events = game.ReplicatedStorage:WaitForChild("Events")
local itemBuying = "SpeedCoil"

script.Parent.MouseButton1Click:Connect(function()
    mps:PromptGamePassPurchase(player, passId)
        events.GamepassBuy:FireServer(player,passId,itemBuying)
end)

--local script for carpet
local player = game.Players.LocalPlayer
local mps = game:GetService("MarketplaceService")
local passId = 247207087  
local events = game.ReplicatedStorage:WaitForChild("Events")
local itemBuying = "MagicCarpet"

script.Parent.MouseButton1Click:Connect(function()
    mps:PromptGamePassPurchase(player, passId)
        events.GamepassBuy:FireServer(player,passId,itemBuying)
    
end)

--server script

local events = game.ReplicatedStorage:WaitForChild("Events")
local Tool = game.ServerStorage:WaitForChild("GravityCoil")
local Tool2 = game.ServerStorage:WaitForChild("SpeedCoil")
local tool3 = game.ServerStorage:WaitForChild("MagicCarpet")
local ms = game:GetService("MarketplaceService")

events.GamepassBuy.OnServerEvent:Connect(function(player,id,itemBuying)
    local char = player.Character  
    
    if mps.PromptGamePassPurchaseFinished(player.UserId,id,isPurchased) then
if isPurchased = true then
        local clone = game.ServerStorage:WaitForChild(itemBuying):Clone()
        clone.Parent = player.Backpack
        end
end
end)
    



    ```
#

that now

opal olive
#

alright ill test

summer gale
#

alr

opal olive
#

ServerScriptService.CoilGamepass:10: attempt to call a RBXScriptSignal value - Server - CoilGamepass:10
18:05:49.703 Players.JayKPS.PlayerGui.PopUps.ImageLabel.SpeedBtn.LocalScript:9: attempt to call a RBXScriptSignal value - Client - LocalScript:9
18:05:51.318 Players.JayKPS.PlayerGui.PopUps.ImageLabel.SpeedBtn.LocalScript:9: attempt to call a RBXScriptSignal value - Client - LocalScript:9
18:05:51.885 Players.JayKPS.PlayerGui.PopUps.ImageLabel.SpeedBtn.LocalScript:9: attempt to call a RBXScriptSignal value - Client - LocalScript:9
18:05:54.785 Players.JayKPS.PlayerGui.PopUps.ImageLabel.SpeedBtn.LocalScript:9: attempt to call a RBXScriptSignal value - Client - LocalScript:9
18:05:55.002 Players.JayKPS.PlayerGui.PopUps.ImageLabel.SpeedBtn.LocalScript:9: attempt to call a RBXScriptSignal value - Client - LocalScript:9
18:05:55.269 Players.JayKPS.PlayerGui.PopUps.ImageLabel.SpeedBtn.LocalScript:9: attempt to call a RBXScriptSignal value - Client - LocalScript:9
18:05:55.435 Players.JayKPS.PlayerGui.PopUps.ImageLabel.SpeedBtn.LocalScript:9: attempt to call a RBXScriptSignal value - Client - LocalScript:9
18:05:55.601 Players.JayKPS.PlayerGui.PopUps.ImageLabel.SpeedBtn.LocalScript:9: attempt to call a RBXScriptSignal value - Client - LocalScript:9
18:05:55.768 Players.JayKPS.PlayerGui.PopUps.ImageLabel.SpeedBtn.LocalScript:9: attempt to call a RBXScriptSignal value - Client - LocalScript:9
18:06:07.534 ServerScriptService.CoilGamepass:10: attempt to call a RBXScriptSignal value - Server - CoilGamepass:10

#

if ms.PromptGamePassPurchaseFinished(player.UserId,id) then says this is the problem in the server script

#

if mps.PromptGamePassPurchaseFinished(player.UserId,passId) then

#

for the speedbtn

summer gale
#

hm

#

print player

#

see what that says

opal olive
#

on the local player?

summer gale
#

yeah

#

just to make sure it works

opal olive
#

on all scripts or just the one

summer gale
#

just 1

#

wait

#

do user id

#

player.UserId

#

see if that prints

opal olive
#

wheres the playeruserid?

#

oh

#

there

summer gale
#

player.UserId

opal olive
#

if mps.PromptGamePassPurchaseFinished(player.UserId,passId) then
print("player")

#

here?

summer gale
#

yeah

#

wait

#

no

#

right after the click function

#

print(player.UserId)

opal olive
#

script.Parent.MouseButton1Click:Connect(function()
print(player.UserId)

#

here?

summer gale
#

yes

opal olive
summer gale
#

ok so that works

#

it must be something with the gamepass ids then

#

but it prompts right

opal olive
#

yeah it prompts fine

summer gale
#

ok

#

so

#

are you sure you put the right script

#

like whenever i send the script your supposed to copy it

#

which you didnt again

opal olive
#

i did copy it

summer gale
#

i can fix it 1s

#

no you didnt

#

it shouldnt happen on the local script

#

it would happen on the server

#

not the localscript

opal olive
#

ohh i think i might be in the game whilst im copy and pasting cuz then it wont save

summer gale
#

bro

#

DONT

#

go in THE GAME

#

ok

#

dont copy the script yet

#

leave the game

#

dont test

#

go to studio

#

dont test it

opal olive
#

okay

summer gale
#

copy now

#

except in the server script

#

make sure theres two equal signes after if ispurchased = tgrue

#

true*

#

do if ispurchased == true

#

and wait 1s

#

i gotta modify it again oh god

#

this was supposed to take like 5 mins cus its so easy but i keep forgetting stuff

opal olive
#

thats fine dw, i appreciate u trying to help

summer gale
#

itll work after im done

#

i think

#
--local script for grav coil

local player = game.Players.LocalPlayer
local mps = game:GetService("MarketplaceService")
local passId = 247206424  
local events = game.ReplicatedStorage:WaitForChild("Events")
local itemBuying = "GravityCoil"

script.Parent.MouseButton1Click:Connect(function()
    mps:PromptGamePassPurchase(player, passId)
end)


-- local script for speed coil
local player = game.Players.LocalPlayer
local mps = game:GetService("MarketplaceService")
local passId = 247206697 
local events = game.ReplicatedStorage:WaitForChild("Events")
local itemBuying = "SpeedCoil"

script.Parent.MouseButton1Click:Connect(function()
    mps:PromptGamePassPurchase(player, passId)
end)

--local script for carpet
local player = game.Players.LocalPlayer
local mps = game:GetService("MarketplaceService")
local passId = 247207087  
local events = game.ReplicatedStorage:WaitForChild("Events")
local itemBuying = "MagicCarpet"

script.Parent.MouseButton1Click:Connect(function()
    mps:PromptGamePassPurchase(player, passId)
    
end)

--server script

local events = game.ReplicatedStorage:WaitForChild("Events")
local Tool = game.ServerStorage:WaitForChild("GravityCoil")
local Tool2 = game.ServerStorage:WaitForChild("SpeedCoil")
local tool3 = game.ServerStorage:WaitForChild("MagicCarpet")
local ms = game:GetService("MarketplaceService")

ms.PromptProductPurchaseFinished:Connect(function(player, assetid, isPurchased)
    local char = player.Character  
    if isPurchased == true then
        if assetid == 247207087 then
            local clone = tool3:Clone()
            clone.Parent = player.Backpack
        elseif assetid == 247206697 then
            local Clone = Tool2:Clone()
            Clone.Parent = player.Backpack
        elseif assetid == 247206424 then
            local clone1 = Tool:Clone()
            clone1.Parent = player.Backpack
        end
    end
end)
    


    ```
#

lmk if this works if it doesnt ik why

opal olive
#

no errors, just doesnt appear in my backpack

summer gale
#

i know

#

i gotchu

#

so

#

delete the local char

opal olive
#

server or local script

summer gale
#

server

#

delete the thing that says local char

#

and replace it with local Player = game.Players:GetNameFromUserIdAsync(player)

#

and then change all the things there

#

from player to Player

#

the parents of the clones

#

from player to Player

#

then test

#
    local Player = game.Players:GetNameFromUserIdAsync(player)
    if isPurchased == true then
        if assetid == 247207087 then
            local clone = tool3:Clone()
            clone.Parent = Player.Backpack
        elseif assetid == 247206697 then
            local Clone = Tool2:Clone()
            Clone.Parent = Player.Backpack
        elseif assetid == 247206424 then
            local clone1 = Tool:Clone()
            clone1.Parent = Player.Backpack
        end
    end
end)```
#

like this so its upercase player

#

but dont delete player fromup there

opal olive
#

like this?

summer gale
#

yes

#

but dont delete the player in the function

#

now test

opal olive
#

should i replace the one in the function to an uppercase or just keep it as the normal one

summer gale
#

no

#

keep

#

now test

opal olive
#

was i supposed to do something with the Clone.Parent

summer gale
#

no just change the parent

opal olive
#
ms.PromptProductPurchaseFinished:Connect(function(player, assetid, isPurchased)
    local Player = game.Players:GetNameFromUserIdAsync(player)
    if isPurchased == true then
        if assetid == 247207087 then
            local clone = tool3:Clone()
            clone.Parent = Player.Backpack
        elseif assetid == 247206697 then
            local Clone = Tool2:Clone()
            Clone.Parent = Player.Backpack
        elseif assetid == 247206424 then
            local clone1 = Tool:Clone()
            clone1.Parent = Player.Backpack
        end
    end
end)```
#

is this all correct? also, the items still dont appear so surely its got to do something with me

summer gale
#

print Player

#

and player

#

both

#

right before you do local Player

#

after

#

sorry

#

print(player,Player)

opal olive
summer gale
#

after

#

Player

#

not before

#

mb

opal olive
#

oh sorry

summer gale
#

all good

opal olive
#

i dont see anywhere where the player.Player could work

#

like nothing is appearing in the output

#

other than the other things in my game

summer gale
#

did the purchase go through

#

oh i got it

#

1s

#

i closed studio

#

ok

#

so

#

you know that server script

opal olive
#

teah

#

yeah

summer gale
#

put all of that into a local script in startergui

#

and delete the server script

opal olive
#

like this?

summer gale
#

yes

#

make sure it has the same stuff

opal olive
#

yeah it does

summer gale
#

k

#

delete the server script now text

#

test*

opal olive
#

this is all it shows in the output even with nothing in my backpack

summer gale
#

okay have of that aint me

#

but

#

the last one

#

whats the 2nd line

#

the tool right

opal olive
#

second to last?

summer gale
#

2nd

#

line

opal olive
#

stack end?

fossil kilnBOT
#

studio** You are now Level 12! **studio

summer gale
#

no

#

ok

#

just send the pic of all the items in server sotrage

opal olive
summer gale
#

ok

#

put them in replicated storage

#

in a folder called "Tools"

opal olive
#

is this all good?

summer gale
#

yes

#

now

#

in the local script

#

change the 3 tools to this

#

local Tool = game.ReplicatedStorage:WaitForChild("Tools"):FindFirstChild("GravityCoil")
local Tool2 = game.ReplicatedStorage:WaitForChild("Tools"):FindFirstChild("SpeedCoil")
local tool3 = game.ReplicatedStorage:WaitForChild("Tools"):FindFirstChild("MagicCarpet")

opal olive
#

okay yeah did that

summer gale
#

test

opal olive
#

this is all its showing in the output window, most of it isnt even about the things we're doing

summer gale
#

yeah its not

#

try to find the thing about the local script

#

in the output

#

try to skim thru and see if u can find anything about player gui> local script

opal olive
#

yeah nothing says anything about playergui > local script

#

just looked throuigh it all

summer gale
#

test again

#

and this time in explorer go to players then you

#

and see if your backpack has anything onc ewur in the game

#

once

opal olive
summer gale
#

nothing in there?

opal olive
#

i dont think so no

#

idk why nothing is there tbh

summer gale
#

it doesnt work basically

#

i have the same exact script

#

in my other game

#

lemme test

#

like in a game

#

ill make 1

opal olive
#

alright thats fine jsut lmk

summer gale
#

paste the local scripts rn

#

if u can

#

i wanna see if i did anyting wrong

opal olive
#

-- Starter guii local script 
local events = game.ReplicatedStorage:WaitForChild("Events")
local Tool = game.ReplicatedStorage:WaitForChild("Tools"):FindFirstChild("GravityCoil")
local Tool2 = game.ReplicatedStorage:WaitForChild("Tools"):FindFirstChild("SpeedCoil")
local tool3 = game.ReplicatedStorage:WaitForChild("Tools"):FindFirstChild("MagicCarpet")
local ms = game:GetService("MarketplaceService")

ms.PromptProductPurchaseFinished:Connect(function(player, assetid, isPurchased)
    local Player = game.Players:GetNameFromUserIdAsync(player)
    print(player,Player)
    if isPurchased == true then
        if assetid == 247207087 then
            local clone = tool3:Clone()
            clone.Parent = Player.Backpack
        elseif assetid == 247206697 then
            local Clone = Tool2:Clone()
            Clone.Parent = Player.Backpack
        elseif assetid == 247206424 then
            local clone1 = Tool:Clone()
            clone1.Parent = Player.Backpack
        end
    end
end)

-- local gravity button
local player = game.Players.LocalPlayer
local mps = game:GetService("MarketplaceService")
local passId = 247206424  
local events = game.ReplicatedStorage:WaitForChild("Events")
local itemBuying = "GravityCoil"

script.Parent.MouseButton1Click:Connect(function()
    mps:PromptGamePassPurchase(player, passId)
end)

-- local speed coil button
local player = game.Players.LocalPlayer
local mps = game:GetService("MarketplaceService")
local passId = 247206697 
local events = game.ReplicatedStorage:WaitForChild("Events")
local itemBuying = "SpeedCoil"

script.Parent.MouseButton1Click:Connect(function()
    mps:PromptGamePassPurchase(player, passId)
end)

-- local magic carpet button
local player = game.Players.LocalPlayer
local mps = game:GetService("MarketplaceService")
local passId = 247207087  
local events = game.ReplicatedStorage:WaitForChild("Events")
local itemBuying = "MagicCarpet"

script.Parent.MouseButton1Click:Connect(function()
    mps:PromptGamePassPurchase(player, passId)

end)
summer gale
#

ok perfect half of those locals u dont need but rly whatever

#

so does the player print

#

in the local script

opal olive
#

errrr

#

no i havent seen anything about it

summer gale
#

maybe above the local Player print (player) there

#

in the big script

opal olive
#

Player isnt defined within the print

summer gale
#

wdym

#

oh ik why

#

maybe

#

idek

#

just try to see if it prints

opal olive
#

its not printin g

summer gale
#

i know why

#

change all of the player to player.UserId

#

i told u to do that but you didnt its alright

#

like in the button script

#

in each button

opal olive
#

cal player = game.Players.LocalPlayer here?

#

or inside the prompt

summer gale
#

no

#

in the prompt

#

yes

opal olive
#

i have done it

summer gale
#

test

#

wait

#

yeah

#

tru

#

try

opal olive
summer gale
#

yeah im testing rn

opal olive
#

yeah its the mps:PromptGamePassPurchase(player.UserId, passId) line

summer gale
#

yeah

#

rem,ove .userid

#

i cant spell

#

remove userid

#

it used to work

#

apparently not anymore

opal olive
#

okay i removed it

summer gale
#

ok

#

i have to do a ton

opal olive
#

thats fine dw

summer gale
#

oh my god

#

im so dumb bruhv

#

nah no way that was it the whole time

opal olive
#

what was it

summer gale
#

look at the big local script

#

its a product purchase thing not gamepass purchase

opal olive
#

ms.PromptProductPurchaseFinished:Connect(function(player, assetid, isPurchased) i already jabe it?

summer gale
#

no

#

change it to

#

ms.PromptGamepassPurchaseFinsished

#

theres an error or too after that

opal olive
#

yeah i was gonna say it didnt work

#

wait

#

hold on

#

oh nvm

#

ms.PromptGamePassPurchaseFinished:Connect(function(player, assetid, isPurchased)
local Player = game.Players:GetNameFromUserIdAsync(player)
if isPurchased == true then
if assetid == 247207087 then
local clone = tool3:Clone()
clone.Parent = Player.Backpack
elseif assetid == 247206697 then
local Clone = Tool2:Clone()
Clone.Parent = Player.Backpack
elseif assetid == 247206424 then
local clone1 = Tool:Clone()
clone1.Parent = Player.Backpack
end
end
end)

#

is this correct

summer gale
#

yeah

#

i think

#

ok now

#

change local Player = game.Players:GetNameFromUserIdAsync(player)
to local Player = game.Players:GetNameFromUserIdAsync(player.UserId)

opal olive
#

okay yeah

summer gale
#

it still doesnt work

opal olive
#

hm

summer gale
#

ok

#

so

#

the upercase player

#

is useless

#

delete that

#

and change all of the other things back to player.Backpack

opal olive
#

okay i did that

summer gale
#

wohoo

#

it works

#

but like

#

you just needa figure out the positioning of the item

#

or it might work for u

#

i was just using a stupid bliock

opal olive
#

wdym by positioning

summer gale
#

just stuff for parts

#

ur fine

#

ok

opal olive
#

okay will it work

summer gale
#

no

#

its locally

opal olive
#

ohh

summer gale
#

that local script should be a server script again

#

lol

#

it works but its not in my inv hm

opal olive
#

ah i see

summer gale
#

there you go

#

it works

opal olive
#

do i have to change the local script to a server script

summer gale
#

which one

opal olive
#

the big one

summer gale
#

yeah

#

the one in gui

opal olive
#

okay

summer gale
#

and put it in sss

#

server script storage

opal olive
#

put the script in storage?

summer gale
#

yes

#

no

#

server script storage

#

not server storage

#

Does it work

opal olive
#

IT WORKSSS

#

TYSMMM

#

i really do appreciate u helping a lot

summer gale
#

There you go no problem things happen

opal olive
#

i appreciate it

#

quickly

#

how do i change how high i can go with the gravity coil?

#

because it doesnt really seem to be making me jumo high

#

and also will it save or will it just have to be repurchased

summer gale
#

It won’t save

#

Normally you don’t want it to save

#

When you die it might go away but you can fix that

#

Idk how to fix how high to jump prob in the item itself

opal olive
#

ahhh i see okay

#

thank you

#

in team test, it doesnt seem to be working?

opal olive
#

@summer gale i tried doing this to make my gears not go after death, but whenever i purchase 1, i get all 3

#

here is my code

#
game.ReplicatedStorage.Events.GamepassBuy.OnServerEvent:Connect(function(player)
    Tool:Clone().Parent = player.StarterGear
end)

game.ReplicatedStorage.Events.GamepassBuy.OnServerEvent:Connect(function(player)
    Tool2:Clone().Parent = player.StarterGear
end)
game.ReplicatedStorage.Events.GamepassBuy.OnServerEvent:Connect(function(player)
    tool3:Clone().Parent = player.StarterGear
end)

--local script to the purchase button
script.Parent.Activated:Connect(function()
    game.ReplicatedStorage.Events.GamepassBuy:FireServer()
end)
summer gale
#

Back

#

Give me a lil

#

I’m eating

#

My bad

summer gale
#

Your doing the function like twelve times

#

I can fix that in a while maybe

summer gale
summer gale
#

your firing the same event

#

delete that whole script it doesnt do anything really

#

I dont think itl work

#
local Game = game
local Players = Game:GetService("Players")

local function OnPlayerAdded(Player)
    local function OnCharacterAdded(Character)
        local Backpack = Player:FindFirstChildOfClass("Backpack") or Player:WaitForChild("Backpack")
        local Humanoid = Player:FindFirstChildOfClass("Humanoid") or Player:WaitForChild("Humanoid")
        
        local function OnHumanoidDied()
            Humanoid:UnequipTools()
            for _, Tool in ipairs(Backpack:GetChildren()) do
                Tool.Parent = Player
            end
        end
        
        Humanoid.Died:Connect(OnHumanoidDied)
        for _, Tool in ipairs(Player:GetChildren()) do
            if not (Tool:IsA("Tool")) then continue end
            Tool.Parent = Backpack
        end
    end
    
    Player.CharacterAdded:Connect(OnCharacterAdded)
end

Players.PlayerAdded:Connect(OnPlayerAdded)```
#

I didnt make this but it does the trick

#

prob wont work but you can tweak

opal olive
opal olive
#

doesn't seem to work?

#

i put it in my server script where the rest is and i dont think its working

#

considering one of the tools is called "Tool", i thought it wouod''ve picked it up and cloned it but it's not really doing anything

summer gale
#

Bro I told you it won’t work

#

I just said it’s an example

#

You don’t want to name all of them tool

summer gale
opal olive
#

just don't know what to change

summer gale
#

Don’t make all of them tool

#

Nothing

#

Don’t put it in that script

#

Make a different one

opal olive
#

okay

#

local or server?

summer gale
#

Server

opal olive
#

alright i did that

summer gale
#

Ok

#

Test and see if anything happens

#

Cus I never even said the script would work

#

You have to actually read the context

opal olive
#

Sorry, i didnt realise

#

i'll test it now and lyk

summer gale
#

Alr

opal olive
#

yeah it dont appear when i die

summer gale
#

Print stuff

#

Add prints to each function

opal olive
#

like this?

summer gale
#

Yeah but that last one makes no sense

#

That’s when a character dies

#

Put it at the front of the script ASWELL as there

#

To see if the script goes tere

opal olive
#

wdym by front of the script tho

summer gale
#

The first part

opal olive
#

like this

#

or somewhere else

summer gale
#

No

#

The function

opal olive
summer gale
#

The first line of the function

#

Yes

opal olive
#

okay

summer gale
#

And then print player

#

There adwell

#

Player not player

opal olive
#

on a different print or replace?

summer gale
#

Different even tho u can print too thints on the same print

opal olive
#

local function OnPlayerAdded(Player)
print("front of script")
print(Player)

#

did something like this if it's correct

summer gale
#

Yes

#

It works

#

You can do a comma ASWELL if you want it in the same print

#

But you don’t have to worry sb that

opal olive
#

alright ty

#

should i test it and see if i can see any of the prints

summer gale
#

Yes

opal olive
#

print player and front of script are the only 2 that are printing

summer gale
#

Can I see your death function

fossil kilnBOT
#

studio** You are now Level 21! **studio

summer gale
#

Like the humanoid died one

opal olive
#
local function OnHumanoidDied()
            Humanoid:UnequipTools()
            for _, Tool in ipairs(Backpack:GetChildren()) do
                Tool.Parent = Player
                print("function tool parents")
            end
        end
        
        Humanoid.Died:Connect(OnHumanoidDied)
        for _, Tool in ipairs(Player:GetChildren()) do
            if not (Tool:IsA("Tool")) then continue end
            Tool.Parent = Backpack
            print("function character dead")
        end
    end```
summer gale
#

Oki know what’s wrong

#

So you see the loop

#

For _,tools

opal olive
#

yeah

summer gale
#

So In the second one

#

The humanoid.died

#

In that looo change it to Player.Backpack:GetChildren()

opal olive
#

okay yeah i ddi it

summer gale
#

Idk if that’s the problem or if it’ll fix it but try it out

#

I can help when I can actually get on

opal olive
#

i'm getting no errors, just disappears still after dying

summer gale
#

Print

#

Like print after the humanoid dies

#

To make sure that works

opal olive
#

here?

summer gale
#

Yes

#

Try that

#

Wait

#

Add another one in the other function

#

That’s called onhumanoid doed

#

At the beftinitn for it

#

Of

opal olive
#

like this?

summer gale
#

Yes

#

Do that

opal olive
#

alright, it's the same 2 that are printing still print(player) and print("front of script")

summer gale
#

Ok now we know the problem

#

Even when you died

#

Did it print

#

Or no

opal olive
#

it didn't print things no

summer gale
#

Ok it’s that then

#

I can try to help when I’m done doing my thing but

#

You can try to print and try to think of thints

#

It won’t take long

opal olive
#

Yeah you're fine dw about it, just ping me whenever you can and i'll keep trying to print things in the process

summer gale
#

Alr I’m getting on

#

Any updates

opal olive
#

not really, i just added a print function where the character added function is but i dont think its printing

summer gale
#

well im on now so ill try

opal olive
#

do u need the script

summer gale
#

wait

#

are you getting that inf yeild

#

or is that just me

opal olive
#

ill check quickly

#

Infinite yield possible on 'Players.JayKPS:WaitForChild("Humanoid")'

#

this?

summer gale
#

yeah i got it

#

i fixed that i think

#

ok yeah if i die it wont work

opal olive
#

yeah same happens to me

summer gale
#

well for starters

#

when you die right

#

the died function doesnt work

#
        local function OnHumanoidDied()
``` this thing
opal olive
#

yeah nothing printed when a print statement was on it so no

summer gale
#

yeah

#

idk why it wont work but ill try

opal olive
#

thank u

summer gale
#

ok i got it

#

so the for loop doesnt work

#

ipairs is weird asf

#

it may be that

#

ok its not that

opal olive
#

yeah most of it dont work

summer gale
#

ok i think i found a script that may work

#

cus im not making onme

opal olive
#

that's fine dw

summer gale
#

ok

#

this works

#

only fif u have it equipped

#

i think

#
game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        repeat
            wait()
        until char:FindFirstChild("Humanoid")
        char:FindFirstChild("Humanoid").Died:Connect(function()
            local tooltable = {}
            if char:FindFirstChildOfClass("Tool") then
                table.insert(tooltable,char:FindFirstChildOfClass("Tool"):Clone())
            end
            for _, v in pairs (plr.Backpack:GetChildren()) do
                table.insert(tooltable,v:Clone())
            end
            wait(game.Players.RespawnTime+1)
            if tooltable ~= {} then
                for _, v in pairs (tooltable) do
                    v.Parent = plr.Backpack
                end
            end
        end)
    end)
end)```
#

this is a new script

#

delete the old script

#

and paste this in

#

it works if you have it equipped and die

opal olive
#

is there a way we can make it so it can also save when you dont have it equipped?

summer gale
#

yes

opal olive
#

it doesnt save for me when i die still

summer gale
#

it does

#

idk wdym

#

you have to have it equipped rn

#

ok it works theres just some goofy error

opal olive
#

the problem is, when i reset or die at any point, it quickly clones it so i have 2 for a split second, but when i respawn, there's nothing there

summer gale
#

huh

#

idk what ur talkin ab

#

lemme send a video

#

it works

opal olive
#

oh what

summer gale
#

even if i dont have it equipped

#

copy the right script

opal olive
#

mine isnt doing that

opal olive
#

its odd

#

ill try show

#

yeah

summer gale
#

show me

#

and then show all the scripts

#

not all yk

#

but

#

that one

#

and where it is

opal olive
#

alright hold on

#

250mb lol

#

wont take long

summer gale
#

250mb

#

how

#

mine was 2

opal olive
#

probs my obs settings

#

idk tho lol

summer gale
#

its alr

opal olive
summer gale
#

how the hell did you die

#

anyway

opal olive
#

r to reset

summer gale
#

i never use that

#

nice to know

#

wait take an ss of all the scripts u have in server script storage

#

like jst how many

opal olive
summer gale
#

huh

#

weird

#

it works for me

#

im fixing it gimmi 1s

opal olive
#

okay

summer gale
#

ok

#

its a lot shorter

#
game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        char:WaitForChild("Humanoid").Died:Connect(function()
            local tooltable = {}
            for _, v in pairs (plr.Backpack:GetChildren()) do
                print(v)
                table.insert(tooltable,v:Clone())
            end
            wait(game.Players.RespawnTime+1)
            if tooltable ~= {} then
                for _, v in pairs (tooltable) do
                    v.Parent = plr.Backpack
                end
            end
        end)
    end)
end)```
#

try this

#

it works but theres some goofy error

opal olive
#

okay ill have a look

#

yeah it still dont work

summer gale
#

oh it does work

#

for me

#

and no errors

#

did you delete the script

#

the old one

opal olive
#

yeah

opal olive
# summer gale ```lua game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Con...
game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        char:WaitForChild("Humanoid").Died:Connect(function()
            local tooltable = {}
            for _, v in pairs (plr.Backpack:GetChildren()) do
                print(v)
                table.insert(tooltable,v:Clone())
            end
            wait(game.Players.RespawnTime+1)
            if tooltable ~= {} then
                for _, v in pairs (tooltable) do
                    v.Parent = plr.Backpack
                end
            end
        end)
    end)
end)```
#

only one im using

summer gale
#
game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        repeat
            wait()
        until char:FindFirstChild("Humanoid")
        char:FindFirstChild("Humanoid").Died:Connect(function()
            local tooltable = {}
            for _, v in pairs (plr.Backpack:GetChildren()) do
                table.insert(tooltable,v:Clone())
                print(tooltable)
            end
            wait(game.Players.RespawnTime + 1)
            if tooltable ~= {} then
                for _, v in pairs (tooltable) do
                    print(v.Name)
                    v.Parent = plr.Backpack
                end
            end
        end)
    end)
end)```
#

use this

#

and try to see if anything prints

opal olive
#

nothings coming up in the output

summer gale
#

ok this is rly weird

#

this is something on ur end idk how to fix it

#

try not using r

#

and going to menu and resetting

#

cus i cant use r

opal olive
#

tried using the reset button on the esc menu and it doesnt save

summer gale
#

huh

#

weird

#

it legit works

opal olive
#

what gravity coil did u use

#

might be the problem

summer gale
#

a block

#

no it isnt

#

if its a tool it aint a problem

#

i can use a real one

opal olive
#

i honestly dont understand why its not working for me either

summer gale
#

let me try with a real one

#

yep it works

#

check all of your scripts for a humanoid.died function

#

and tell me what u find

opal olive
#

the only humanoid.died function i can find is the one thats inside our script

fossil kilnBOT
#

studio** You are now Level 13! **studio

summer gale
#

wait do the video again but this time bef u die

#

just show me player>you>backpack

#

on the client and server

#

so i can see if its actly getting added

opal olive
#

how do i check it on the server

summer gale
#

at the top

#

current

#

:

#

server

opal olive
#

i stillc ant find the server part

summer gale
#

at the top

#

only when ur in testing it shows

#

its on the top bar a little to the right

opal olive
#

oh there

#

i see now

summer gale
#

Current:Serv

#

yes

opal olive
#

doesnt appear in it either

#

even when i die

#

nothing goes in it

summer gale
#

send a video

#

not when u die

#

when u buy it i want u to show me not tell me so i can see

opal olive
summer gale
#

does it appear on server too

opal olive
#

appears in the server backpack

summer gale
#

alr then it should work

#

i got no idea

opal olive
#

i have no idea why its not working'

summer gale
#

me either

#

it works for me

#

you might have to look thru your scripts

#

or ask for other ppl to help in #📜︱scripting

opal olive
#

what happens if i change it from backpack ot startergear

summer gale
#

i dont think itl work

#

starter gear is like the gear u start with yk

opal olive
#

ohhhh i see

#

surely it'd only go there when the person has purchased the gamepass

summer gale
#

where

#

the startergear?

#

dont put anything in there

opal olive
#

when the user purchases the gamepass, it goes to the backpack

summer gale
#

yeah

opal olive
#

i looked ity uip and people are putting it in the startergear from the backpack

summer gale
#

hm

#

you can try but i think its a bad idea

#

since it allready works

opal olive
#

just using :Clone() to let it save permanently

summer gale
#

ill tell you if it works

#

hm

#

maybe

opal olive
#

yeah ik it works but it doesn't save when u die and there's probs no point in buying it at that rate

#

a;rigjt

summer gale
#

startergear

#

?

#

or starterpack

opal olive
#

startergear

summer gale
#

wherers that

#

it aint a thing

opal olive
#

when you load into the game, go to players > ur username, then it'll be below backpack

summer gale
#

ohh

#

yeah it doesnt work

#

cus you cant equip it

opal olive
#

ah i see

summer gale
#
    plr.CharacterAdded:Connect(function(char)
        repeat
            wait()
        until char:FindFirstChild("Humanoid")
        char:FindFirstChild("Humanoid").Died:Connect(function()
            local tooltable = {}
            if char:FindFirstChildOfClass("Tool") then
                table.insert(tooltable,char:FindFirstChildOfClass("Tool"):Clone())
            end
            for _, v in pairs (plr.Backpack:GetChildren()) do
                table.insert(tooltable,v:Clone())
                print(tooltable)
            end
            wait(game.Players.RespawnTime + 1)
            if tooltable ~= {} then
                for _, v in pairs (tooltable) do
                    print(v.Name)
                    v.Parent = plr.StarterGear
                end
            end
        end)
    end)
end)```
#

new script

#

i deleted a par5t

#

it wont change anything i think but

opal olive
#

its working now

summer gale
#

it is?

#

it aint workin for me

opal olive
#

yeah its saving

summer gale
#

oh nbm it does

#

yeah

#

were u testing it while it ws equipped

#

it didnt work be4 when it was equipped

#

now it does

#

it did before actly

opal olive
#

everytime u reset tho it doubles

summer gale
#

hm

#

weird

#

that aint something that happens to me

#

check if u equip it if its still in backpack

#

it shouldnt be

opal olive
#

all of them are duplicating in the backpack

summer gale
#

hm

#

well

#

before u die or after

#

wait

#

nvm

#

when u equip the coil

#

when u buy 1

#

is it still in backpack

opal olive
#

yeah

summer gale
#

huh

#

wait show

opal olive
#

when i buy the coil, it goes to my backpack, but then when i die, it goes to staretergear and then from there you just infinite amounts of gravity coils inside your backpack

summer gale
#

oh

#

ok

#

in the script

#

its my bad

#

i pasted the wrong on

#

in the death script

#

at the bottom

#

v.Parent = plr.Backpack

#

do that

opal olive
#

sorry hold on, i need to eat rq

summer gale
#

kk

opal olive
#

back

summer gale
#

alr

#

just do v.Parent = plr.Backpack

opal olive
#

doesnt go into startergear tho

summer gale
#

yes

#

thats the point

opal olive
#

but it doesnt save

summer gale
#

youre not supposed to use startergear

#

but it does

#

didnt you just said it saved

opal olive
#

because it went in startergear

#

and saved permanently

summer gale
#

but u cant access it

#

so whats the point

#

and you said you didnt want it permanently