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

Game pass function breaks this script, why is this happening?

Asked by 7 years ago

I've tried everything I know to get it to work. I know the main script works because as soon as I remove the game pass functions it works just fine. However, I want to to only activate if a player owns certain game pass. Everything below is the script:

Game.Players.PlayerAdded:connect(function(Player) if Game:GetService("GamePassService"):PlayerHasPass(Player,93044037) then local plr = game.Players.LocalPlayer wait(2) local part = Instance.new('Part', workspace[plr.Name].Torso) part.CanCollide = false part.Anchored = true part.Size = Vector3.new(1,1,1) local mesh = game.ReplicatedStorage.DogeMesh mesh:Clone().Parent = part local direction = CFrame.new(part.Position, plr.Character['Left Leg'].Position).lookVector local increment = direction * 4 while true do wait() part.CFrame = game.Workspace[plr.Name]['Torso'].CFrame + (direction * increment) + Vector3.new(-5,0,0) part.Rotation = game.Workspace[plr.Name]['Torso'].Rotation + (direction * increment) + Vector3.new(-1,-2,increment)

     end
   end
end)
1
Please put ALL of the code into the lua box, not 3 lines. Thank you TheUniPiggy 77 — 7y
0
Fix your code block Goulstem 8144 — 7y

Answer this question