generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Why isn't this script working?

Previous Thread :: Next Thread 
Dark1020 is not online. Dark1020
Joined: 01 Oct 2012
Total Posts: 716
15 Aug 2014 12:02 AM
When you buy a gamepass, This script should check it you own that gamepass and give you a cape if you do.
Heres the script:
Game.Players.PlayerAdded:connect(function(Player)
if Game:GetService("GamePassService"):PlayerHasPass(Player, 172157718) then --Put the ID of your GAME PASS
wait(1)
local plr = Player--game.Players.LocalPlayer
repeat wait() until plr and plr.Character and plr.Character:findFirstChild("Torso")
local torso = plr.Character.Torso
local p = Instance.new("Part", torso.Parent) p.Name = "EpicCape" p.Anchored = false
p.CanCollide = false p.TopSurface = 0 p.BottomSurface = 0 p.BrickColor = BrickColor.new("Really red") local dec = Instance.new("Decal", p) dec.Face = 2 dec.Texture = "http://www.roblox.com/asset/?id=121620522" p.formFactor = "Custom"
p.Size = Vector3.new(.2,.2,.2)
local msh = Instance.new("BlockMesh", p) msh.Scale = Vector3.new(9,17.5,.5)
local motor1 = Instance.new("Motor", p)
motor1.Part0 = p
motor1.Part1 = torso
motor1.MaxVelocity = .01
motor1.C0 = CFrame.new(0,1.75,0)*CFrame.Angles(0,math.rad(90),0)
motor1.C1 = CFrame.new(0,1,.45)*CFrame.Angles(0,math.rad(90),0)
local wave = false
repeat wait(1/44)
local ang = 0.1
local oldmag = torso.Velocity.magnitude
local mv = .002
if wave then ang = ang + ((torso.Velocity.magnitude/10)*.05)+.05 wave = false else wave = true end
ang = ang + math.min(torso.Velocity.magnitude/11, .5)
motor1.MaxVelocity = math.min((torso.Velocity.magnitude/111), .04) + mv
motor1.DesiredAngle = -ang
if motor1.CurrentAngle < -.2 and motor1.DesiredAngle > -.2 then motor1.MaxVelocity = .04 end
repeat wait() until motor1.CurrentAngle == motor1.DesiredAngle or math.abs(torso.Velocity.magnitude - oldmag) >= (torso.Velocity.magnitude/10) + 1
if torso.Velocity.magnitude < .1 then wait(.1) end
until not p or p.Parent ~= torso.Parent
script:Destroy()
end
end)


Report Abuse
Dark1020 is not online. Dark1020
Joined: 01 Oct 2012
Total Posts: 716
15 Aug 2014 12:03 AM
Yes it's a local script,
The name of the local script is Cape
The parent of the Local script named Cape is Workspace.
What's wrong with it?
Report Abuse
Dark1020 is not online. Dark1020
Joined: 01 Oct 2012
Total Posts: 716
15 Aug 2014 12:05 AM
Hmm.
This will either be a simple small fix or a big part of code I left out :/
Report Abuse
Dark1020 is not online. Dark1020
Joined: 01 Oct 2012
Total Posts: 716
15 Aug 2014 12:07 AM
I'm pretty certain the cape script is correct,
Something with the Checking if the player owns the game pass and giving the cape is wrong
Report Abuse
Dark1020 is not online. Dark1020
Joined: 01 Oct 2012
Total Posts: 716
15 Aug 2014 12:08 AM
Bump!
Report Abuse
cade2000 is not online. cade2000
Joined: 09 Aug 2009
Total Posts: 887
15 Aug 2014 12:09 AM
tl;dr xD

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
Report Abuse
Dark1020 is not online. Dark1020
Joined: 01 Oct 2012
Total Posts: 716
15 Aug 2014 12:10 AM
:/
Thanks for the help cade :D
Report Abuse
Dark1020 is not online. Dark1020
Joined: 01 Oct 2012
Total Posts: 716
15 Aug 2014 12:12 AM
bump!1fh28gh
Report Abuse
Dark1020 is not online. Dark1020
Joined: 01 Oct 2012
Total Posts: 716
15 Aug 2014 12:12 AM
System.out.println("Bump!");
Report Abuse
Dark1020 is not online. Dark1020
Joined: 01 Oct 2012
Total Posts: 716
15 Aug 2014 12:14 AM
cout << "Bump!!!!";
Report Abuse
yankeejr is not online. yankeejr
Joined: 04 Jul 2012
Total Posts: 4906
15 Aug 2014 12:34 AM
game.Workspace.["That Made No Sense"]
Report Abuse
Dark1020 is not online. Dark1020
Joined: 01 Oct 2012
Total Posts: 716
15 Aug 2014 12:42 AM
@Yank
Java n C++
Report Abuse
CaptainSource is not online. CaptainSource
Joined: 08 Jun 2013
Total Posts: 848
15 Aug 2014 12:52 AM
too long D:
Report Abuse
ash877 is not online. ash877
Joined: 18 Feb 2008
Total Posts: 5142
15 Aug 2014 01:33 AM
if there's no error then probably gotta do something with that repeat loop.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image