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 » Scripters
Home Search
 

Re: Why doesn't this script work with the gamepass?

Previous Thread :: Next Thread 
Revontheous is not online. Revontheous
Joined: 29 Jan 2009
Total Posts: 6337
18 Aug 2015 06:54 PM
GamePassService = game:GetService("GamePassService")
Player = game.Players.LocalPlayer
Fire = script.Parent:WaitForChild("Frame"):WaitForChild("vipfire")
AssetId = 284878437

function CreateRocket()
local Tool = script.Parent
Rocket = Instance.new("Part")

Rocket.Locked = true
Rocket.Anchored = true
Rocket.BackSurface = 0
Rocket.FrontSurface = 0
Rocket.BottomSurface = 0
Rocket.TopSurface = 0
Rocket.LeftSurface = 0
Rocket.RightSurface = 0
Rocket.Size = Vector3.new(15,15,15)
Rocket.BrickColor = BrickColor.new(26)
Rocket.CanCollide = true

Tool.landmine:Clone().Parent = Rocket
Tool.cleanup:Clone().Parent = Rocket
Tool.Explosion:Clone().Parent = Rocket
end

function Fire(vTarget)
local sound = script.Parent:WaitForChild("GunSound")
sound.SoundId = "rbxasset://sounds\\Rocket shot.wav"
sound.Volume = 1
sound.Parent = Rocket
wait()
sound:Play()

local vHandle = Player.Character:WaitForChild("Sub"):WaitForChild("cannon")

local dir = vTarget - vHandle.Position
dir = computeDirection(dir)

local missile = Rocket:Clone()

local pos = vHandle.Position + (dir * -55)

missile.CFrame = CFrame.new(pos, pos + dir)

missile.landmine.Disabled = false
missile.cleanup.Disabled = false
missile.Parent = game.Workspace
end

function computeDirection(vec)
local lenSquared = vec.magnitude * vec.magnitude
local invSqrt = 1 / math.sqrt(lenSquared)
return Vector3.new(vec.x ,invSqrt, vec.y, invSqrt, vec.z * invSqrt)
end
enabled = true

function onClicked()
if not enabled then return end
if GamePassService:PlayerHasPass(Player, AssetId) then
enabled = false
Fire(Player.Character.Sub.cannon.CFrame.lookVector * 1000000)
CreateRocket()
wait(2)
enabled = true
end
end
Fire.MouseButton1Down:connect(onClicked)

I don't understand... There doesn't seem to be any errors or anything, it's just not working... :/ Could someone help me please?
Report Abuse
pischokiller is not online. pischokiller
Joined: 16 Dec 2011
Total Posts: 3902
18 Aug 2015 06:55 PM
Dosent line 1 give arror couse its used?
Report Abuse
Revontheous is not online. Revontheous
Joined: 29 Jan 2009
Total Posts: 6337
18 Aug 2015 06:55 PM
I'm not sure I understand what you mean...
Report Abuse
Revontheous is not online. Revontheous
Joined: 29 Jan 2009
Total Posts: 6337
18 Aug 2015 07:03 PM
Bump...
Report Abuse
Revontheous is not online. Revontheous
Joined: 29 Jan 2009
Total Posts: 6337
18 Aug 2015 07:09 PM
Bumpity Bump..
Report Abuse
Revontheous is not online. Revontheous
Joined: 29 Jan 2009
Total Posts: 6337
18 Aug 2015 10:29 PM
Here's the output:
18:16:43.873 - Players.Player.PlayerGui.normal_vipsubcontroles.MineScript:70: attempt to index global 'Fire' (a function value)
18:16:43.874 - Stack Begin
18:16:43.875 - Script 'Players.Player.PlayerGui.normal_vipsubcontroles.MineScript', Line 70
18:16:43.875 - Stack End


I have to change a variable but I'm not that experienced with doing that, so could someone help me with that...


If I didn't have any bad luck, I'd have no luck at all!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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