Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Game pass script doesn't work, with no reason as to why?

Asked by
xJesss 5
9 years ago

Okay, so I've created a script to inject a Localscript into the players body with the coding being --

game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) script.Gamepasses:clone().Parent = character end) end)

this part works fine, I am just giving every detail.

Next, I inserted a local script named "Gamepasses" (as stated above) with the following code --

01local cashvip = 254637214
02local orbitalvip = 254911738
03 
04 
05function hascash(player) -- checks to see if the player owns your pass
06    return game:GetService("MarketplaceService"):PlayerOwnsAsset(player, cashvip)
07end
08function hasorbital(player) -- checks to see if the player owns your pass
09    return game:GetService("MarketplaceService"):PlayerOwnsAsset(player, orbitalvip)
10end
11 
12game.Players.PlayerAdded:connect(function(plr)
13    if hascash(plr) then
14     local sparkles = Instance.new("ParticleEmitter")
15sparkles.Parent = game.Players.LocalPlayer.Character.Torso
View all 40 lines...

Essentially, what I intended the script to do was check whether or not the player had the cash vip or orbital vip game passes. If they had the cash vip, green sparkles are inserted into their torso

if they have the orbital vip, their walkspeed becomes 20, and their health becomes 125.

additionally, if they're in the group, they're supposed to have white fire inserted into their torso

However, none of this works, and the output gives 0 reason as to why. It says there are no errors in the script, it just... doesnt work!

0
Please correctly format ALL of the code. alphawolvess 1784 — 9y

Answer this question