Game pass script doesn't work, with no reason as to why?
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 --
01 | local cashvip = 254637214 |
02 | local orbitalvip = 254911738 |
05 | function hascash(player) |
06 | return game:GetService( "MarketplaceService" ):PlayerOwnsAsset(player, cashvip) |
08 | function hasorbital(player) |
09 | return game:GetService( "MarketplaceService" ):PlayerOwnsAsset(player, orbitalvip) |
12 | game.Players.PlayerAdded:connect( function (plr) |
14 | local sparkles = Instance.new( "ParticleEmitter" ) |
15 | sparkles.Parent = game.Players.LocalPlayer.Character.Torso |
17 | sparkles.Rotation = NumberRange.new( 0 , 90 ) |
18 | sparkles.RotSpeed = NumberRange.new( 1 , 8 ) |
19 | local Color 1 = Color 3. new( 0 , 255 , 0 ) |
20 | local Color 2 = Color 3. new( 0 , 85 , 0 ) |
21 | sparkles.Color = ColorSequence.new(Color 1 ,Color 2 ) |
22 | sparkles.VelocitySpread = 30 |
23 | sparkles.Speed = NumberRange.new( 5 , 8 ) |
24 | sparkles.Size = NumberSequence.new( 0.5 , 0.6 , 0.5 , 0.6 , 0.5 ) |
25 | sparkles.Lifetime = NumberRange.new( 1 ) |
28 | if hasorbital(plr) then |
29 | game.Players.LocalPlayer.Character.Humanoid.Walkspeed = 20 |
30 | game.Players.LocalPlayer.Character.MaxHealth = 125 |
31 | game.Players.LocalPlayer.Character.Health = 125 |
34 | if game.Players.PlayerAdded.IsInGroup( 2587858 ) then |
35 | local fire = Instance.new( "Fire" ) |
36 | fire.Parent = game.Players.LocalPlayer.Character.Torso |
37 | fire.Color = Color 3. new( 0 , 0 , 0 ) |
38 | fire.SecondaryColor = Color 3. new( 0 , 0 , 0 ) |
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!