#help with gravity coil gamepass
1 messages · Page 1 of 1 (latest)
And you can check if a user owns a gamepass
Not if the purchase is finished
That’s useless for your script rn
i'm not very familiar with scripting so i dont understand some things still
could you help at all?
yeah just give me a little i can rewrite it and help you
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?
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
yes
ok
first of all
can you make a folder in replicated storage called Events for me
because thats what im making in the script
3ok
now
in the folder
make a remote event
call it 'GamepassBuy'
without those brackets ofc
i have indeed done that too
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
i haven't really touched on remotevents yet so i dont have anything to put in there lol
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
this pops up on when you click the button
hm
is it a product
or a gamepass
it needs to be a gamepass
thats why i chjanged it
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
is what a one time thing?
i'm not sure on how to check, and yeah that's fine dw, take ur time
its an obby
oh
ok
well
do you want the player to always have the item
or just until they leave the game or die
i think it might be better to let them have it when they leave or die
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
if they die or leave, i want it to stay with them
for when they join back
if thats possible
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
is it the asset id that i need to use then?
no
you need to make it a gamepass
just make a gamepass
ohhh i see
alright
247206424 is the asset id for the gravity coil
i think thegamepasses are speed coil and magic carpet for the rest
if thats alright
i dont wanna overload u with anything
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
ohhhh thank you, ill send the rest now
247206697 - speed coil
247207087 - magic carpet
tysm i really do appreciate it
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
where do i put the gravity coil model aswell?
server storage
put them all in there
with the names- 'GravityCoil','SpeedCoil' and 'MagicCarpet'
do i make a seperate script for them all or put it in the same one
seperate
even the server script?
the sever script goes in server script storage
so where it says server script
put that whole thing in a server script in sss
the gravity coil still does this part, the speed and carpet purchases are working but it doesnt appear in my inv
ok gimmi a sec
so
the gravity coil
its probally a gamepass
not
a gamepass
the other 2 must be
oh yeah oops
my bad
yeah the purchase is working on all but doesn't appear in my inv
that's fine dw about it
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
okay yeah ill have a look
alr
also, is this supposed to bne like this?
oh oops
wrong thing
that was the speed coil gamepass mb
lol its fine
i replaced them all with player.Backpack and still doesn't appear
could it be the coils themselves?
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
here?
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
like this?
i dont think its appearing
is output on?
output is on yeah
send one of the local scripts
from the imagebutton?
yeh
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)```
okay yeah ive done that
now test
no idea
did you change all of the
them
to the new ones
because you had the old ones
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?
yeah ik i just put them together here to make it easier
events.GamepassBuy:FireServer(player,passId,itemBuying)
print("Remote Received")
like this?
also is there a way i can remove most of the things that appear in the output so i can see the prints easier 😭
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")
should i put the prints that already exist above it?
no
print("magic carpet")
elseif itemBuying == "MagicCarpet" then
local clone = tool3:Clone()
clone.Parent = player.Backpack
print("purchased")
like this?
local char = player.Character
print("remote received server")
if itemBuying == "GravityCoil" then
im guessing there
above them all
okay
try to see if it prints
yeah
accidentally had another model in
the scripts?
yeah they are right
yeahyeah
im clickign and its not sending me anywhere
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)
i dont see anything
but it prompts you right
yeah
Players.JayKPS.PlayerGui.PopUps.ImageLabel.GravBtn.LocalScript:9: attempt to call a RBXScriptSignal value - Client - LocalScript:9
if mps.PromptGamePassPurchaseFinished(player.UserId,passId) then
oh?
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
alright ill test
alr
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
on the local player?
on all scripts or just the one
player.UserId
if mps.PromptGamePassPurchaseFinished(player.UserId,passId) then
print("player")
here?
yes
ok so that works
it must be something with the gamepass ids then
but it prompts right
yeah it prompts fine
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
here
copy this
wait dont
i did copy it
i can fix it 1s
no you didnt
it shouldnt happen on the local script
it would happen on the server
not the localscript
ohh i think i might be in the game whilst im copy and pasting cuz then it wont save
bro
DONT
go in THE GAME
ok
dont copy the script yet
leave the game
dont test
go to studio
dont test it
okay
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
thats fine dw, i appreciate u trying to help
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
no errors, just doesnt appear in my backpack
server or local script
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
like this?
should i replace the one in the function to an uppercase or just keep it as the normal one
was i supposed to do something with the Clone.Parent
no just change the parent
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
print Player
and player
both
right before you do local Player
after
sorry
print(player,Player)
oh sorry
all good
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
did the purchase go through
oh i got it
1s
i closed studio
ok
so
you know that server script
yeah it does
this is all it shows in the output even with nothing in my backpack
second to last?
stack end?
** You are now Level 12! **
is this all good?
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")
okay yeah did that
test
this is all its showing in the output window, most of it isnt even about the things we're doing
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
yeah nothing says anything about playergui > local script
just looked throuigh it all
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
nothing in there?
it doesnt work basically
i have the same exact script
in my other game
lemme test
like in a game
ill make 1
alright thats fine jsut lmk
-- 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)
ok perfect half of those locals u dont need but rly whatever
so does the player print
in the local script
Player isnt defined within the print
its not printin g
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
i have done it
yeah im testing rn
yeah its the mps:PromptGamePassPurchase(player.UserId, passId) line
yeah
rem,ove .userid
i cant spell
remove userid
it used to work
apparently not anymore
okay i removed it
thats fine dw
what was it
ms.PromptProductPurchaseFinished:Connect(function(player, assetid, isPurchased) i already jabe it?
no
change it to
ms.PromptGamepassPurchaseFinsished
theres an error or too after that
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
yeah
i think
ok now
change local Player = game.Players:GetNameFromUserIdAsync(player)
to local Player = game.Players:GetNameFromUserIdAsync(player.UserId)
okay yeah
it still doesnt work
hm
ok
so
the upercase player
is useless
delete that
and change all of the other things back to player.Backpack
okay i did that
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
wdym by positioning
okay will it work
ohh
that local script should be a server script again
lol
it works but its not in my inv hm
ah i see
do i have to change the local script to a server script
which one
the big one
okay
put the script in storage?
There you go no problem things happen
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
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
@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)
Don’t do that
Your doing the function like twelve times
I can fix that in a while maybe
it should work
yes
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
how do i make it apply to multiple tools tho
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
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
Don’t name any of them took it doesn’t matter if you do it don’t
i havent changed the name of any of it
just don't know what to change
Don’t make all of them tool
Nothing
Don’t put it in that script
Make a different one
Server
alright i did that
Ok
Test and see if anything happens
Cus I never even said the script would work
You have to actually read the context
Alr
yeah it dont appear when i die
like this?
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
wdym by front of the script tho
The first part
okay
on a different print or replace?
Different even tho u can print too thints on the same print
local function OnPlayerAdded(Player)
print("front of script")
print(Player)
did something like this if it's correct
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
Yes
Can I see your death function
** You are now Level 21! **
Like the humanoid died one
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```
yeah
So In the second one
The humanoid.died
In that looo change it to Player.Backpack:GetChildren()
okay yeah i ddi it
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
i'm getting no errors, just disappears still after dying
Yes
Try that
Wait
Add another one in the other function
That’s called onhumanoid doed
At the beftinitn for it
Of
alright, it's the same 2 that are printing still print(player) and print("front of script")
it didn't print things no
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
Yeah you're fine dw about it, just ping me whenever you can and i'll keep trying to print things in the process
not really, i just added a print function where the character added function is but i dont think its printing
well im on now so ill try
do u need the script
ill check quickly
Infinite yield possible on 'Players.JayKPS:WaitForChild("Humanoid")'
this?
yeah same happens to me
well for starters
when you die right
the died function doesnt work
local function OnHumanoidDied()
``` this thing
yeah nothing printed when a print statement was on it so no
thank u
ok i got it
so the for loop doesnt work
ipairs is weird asf
it may be that
ok its not that
yeah most of it dont work
that's fine dw
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
is there a way we can make it so it can also save when you dont have it equipped?
yes
it doesnt save for me when i die still
it does
idk wdym
you have to have it equipped rn
ok it works theres just some goofy error
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
oh what
mine isnt doing that
do you have this
show me
and then show all the scripts
not all yk
but
that one
and where it is
its alr
r to reset
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
okay
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
yeah
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
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
nothings coming up in the output
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
tried using the reset button on the esc menu and it doesnt save
i honestly dont understand why its not working for me either
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
the only humanoid.died function i can find is the one thats inside our script
** You are now Level 13! **
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
how do i check it on the server
i stillc ant find the server part
at the top
only when ur in testing it shows
its on the top bar a little to the right
send a video
not when u die
when u buy it i want u to show me not tell me so i can see
does it appear on server too
appears in the server backpack
i have no idea why its not working'
me either
it works for me
you might have to look thru your scripts
or ask for other ppl to help in #📜︱scripting
what happens if i change it from backpack ot startergear
when the user purchases the gamepass, it goes to the backpack
yeah
i looked ity uip and people are putting it in the startergear from the backpack
just using :Clone() to let it save permanently
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
startergear
when you load into the game, go to players > ur username, then it'll be below backpack
ah i see
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
its working now
yeah its saving
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
everytime u reset tho it doubles
hm
weird
that aint something that happens to me
check if u equip it if its still in backpack
it shouldnt be
all of them are duplicating in the backpack
hm
well
before u die or after
wait
nvm
when u equip the coil
when u buy 1
is it still in backpack
yeah
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
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
sorry hold on, i need to eat rq
kk
back
doesnt go into startergear tho
but it doesnt save