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: Could someone fix this for me? + Output

Previous Thread :: Next Thread 
cokePanda is not online. cokePanda
Joined: 30 Dec 2008
Total Posts: 1901
27 Mar 2015 10:42 PM
local Player = script.Parent.Parent.Parent.Parent
local pGui = Player:WaitForChild("PlayerGui")
local Character = Player.Character or Player.CharacterAdded:wait()
local Torso = Character:WaitForChild("Torso")
local GamePassService = game:GetService("GamePassService")
local passId = 230028426
local vip = Character:FindFirstChild("Head")
local vip2 = vip:FindFirstChild("vipstring")



script.Parent.MouseButton1Click:connect(function()
if(GamePassService:PlayerHasPass(Player,passId))then
Torso.CFrame = CFrame.new(-719.675, -8.7, 368.333) wait(1)
elseif vip2.Value == true then print'finally works' wait(1)
pGui.NoPass.NoPass.Visible = true
wait(5)
pGui.NoPass.NoPass.Visible = false
game:GetService("MarketplaceService"):PromptPurchase(Player,passId) wait(1)
end
end)



Output:

03:39:29.112 - Players.Player.PlayerGui.Island.Button.Script:15: attempt to index upvalue 'vip2' (a nil value)
03:39:29.113 - Stack Begin
03:39:29.113 - Script 'Players.Player.PlayerGui.Island.Button.Script', Line 15
03:39:29.114 - Stack End



Facts:
The value IS inside the Character's Head.
The value IS set to TRUE.
The script is a Server Script.
The script is inside of a GUI Butoon.
Report Abuse
cokePanda is not online. cokePanda
Joined: 30 Dec 2008
Total Posts: 1901
27 Mar 2015 10:51 PM
bump
Report Abuse
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
27 Mar 2015 10:58 PM
For the first line, 'game.Players.LocalPlayer' is more efficient.

And, 'MouseButton1Click' doesn't work, 'MouseButton1Down' would I believe.
Haven't scripted rbx.lua for awhile but try that.
Report Abuse
Lecturous is not online. Lecturous
Joined: 17 Aug 2013
Total Posts: 1096
27 Mar 2015 11:16 PM
@heli
he said "This script is a server script"
LocalPlayer only in LocalScript
Report Abuse
cokePanda is not online. cokePanda
Joined: 30 Dec 2008
Total Posts: 1901
27 Mar 2015 11:16 PM
http://wiki.roblox.com/index.php?title=MouseButton1Click&redirect=no

MouseButton1Click is fine too
Report Abuse
cokePanda is not online. cokePanda
Joined: 30 Dec 2008
Total Posts: 1901
27 Mar 2015 11:18 PM
I have posted the output too, and I am unable to fix what's going on - because everything appears to be correct.
Report Abuse
cokePanda is not online. cokePanda
Joined: 30 Dec 2008
Total Posts: 1901
27 Mar 2015 11:34 PM
bump
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
27 Mar 2015 11:36 PM
You have to define what vip2 is INSIDE the function not, outside. This annoyed me but its just how lua works.
Report Abuse
cokePanda is not online. cokePanda
Joined: 30 Dec 2008
Total Posts: 1901
27 Mar 2015 11:42 PM
Whoa, that took me good few hours of trying different things.
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
28 Mar 2015 11:28 AM
Trust me, things have never frustrated me more than the syntax of Lua.
Report Abuse
Lentzified is not online. Lentzified
Joined: 06 Dec 2009
Total Posts: 138
28 Mar 2015 11:33 AM
local Player = script.Parent.Parent.Parent.Parent
local pGui = Player:WaitForChild("PlayerGui")
local Character = Player.Character or Player.CharacterAdded:wait()
local Torso = Character:WaitForChild("Torso")
local GamePassService = game:GetService("GamePassService")
local passId = 230028426
local vip = Character:FindFirstChild("Head")
local vip2 = vip:FindFirstChild("vipstring")

repeat
wait()
until Player and pGui and Character and Torso and vip and vip2

script.Parent.MouseButton1Click:connect(function()
if(GamePassService:PlayerHasPass(Player,passId))then
Torso.CFrame = CFrame.new(-719.675, -8.7, 368.333) wait(1)
elseif vip2.Value == true then print'finally works' wait(1)
pGui.NoPass.NoPass.Visible = true
wait(5)
pGui.NoPass.NoPass.Visible = false
game:GetService("MarketplaceService"):PromptPurchase(Player,passId) wait(1)
end
end)

they don't all load at the same time.
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