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 --
local cashvip = 254637214
local orbitalvip = 254911738
function hascash(player) -- checks to see if the player owns your pass
return game:GetService("MarketplaceService"):PlayerOwnsAsset(player, cashvip)
end
function hasorbital(player) -- checks to see if the player owns your pass
return game:GetService("MarketplaceService"):PlayerOwnsAsset(player, orbitalvip)
end
game.Players.PlayerAdded:connect(function(plr)
if hascash(plr) then
local sparkles = Instance.new("ParticleEmitter")
sparkles.Parent = game.Players.LocalPlayer.Character.Torso
sparkles.Texture = ("http://www.roblox.com/asset/?id=243891919")
sparkles.Rotation = NumberRange.new(0,90)
sparkles.RotSpeed = NumberRange.new(1,8)
local Color1 = Color3.new(0,255,0)
local Color2 = Color3.new(0,85,0)
sparkles.Color = ColorSequence.new(Color1,Color2)
sparkles.VelocitySpread = 30
sparkles.Speed = NumberRange.new(5,8)
sparkles.Size = NumberSequence.new(0.5,0.6,0.5,0.6,0.5)
sparkles.Lifetime = NumberRange.new(1)
sparkles.Rate = 50
end
if hasorbital(plr) then
game.Players.LocalPlayer.Character.Humanoid.Walkspeed = 20
game.Players.LocalPlayer.Character.MaxHealth = 125
game.Players.LocalPlayer.Character.Health = 125
end
if game.Players.PlayerAdded.IsInGroup(2587858)then
local fire = Instance.new("Fire")
fire.Parent = game.Players.LocalPlayer.Character.Torso
fire.Color = Color3.new(0,0,0)
fire.SecondaryColor = Color3.new(0,0,0)
end
end)
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!

1 comment
Please correctly format ALL of the code.