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: Player Transparency Gamepass

Previous Thread :: Next Thread 
KodakKid3 is not online. KodakKid3
Joined: 25 Dec 2008
Total Posts: 2860
14 Mar 2014 04:56 PM
The upper part of the script, coloring the character and giving it a new face, apply to all people. That part works fine. The gamepass part though, should make someone's parts .8 transparency if they have the pass. It doesn't.

Help?


local passId = 149612481

game.Players.PlayerAdded:connect(function(p)
p.CanLoadCharacterAppearance = false
p.CharacterAdded:connect(function(c)
c.Torso.BrickColor = BrickColor.new("Dark stone grey")
c.Head.BrickColor = BrickColor.new("Institutional white")
c["Right Arm"].BrickColor = BrickColor.new("Institutional white")
c["Left Arm"].BrickColor = BrickColor.new("Institutional white")
c["Right Leg"].BrickColor = BrickColor.new("Dark stone grey")
c["Left Leg"].BrickColor = BrickColor.new("Dark stone grey")
c.Head.face.Texture = "http://www.roblox.com/asset/?id=8560915"
function isAuthenticated(player)
return game:GetService("GamePassService"):PlayerHasPass(player, passId)
end
game.Players.PlayerAdded:connect(function(p)
if isAuthenticated(p) then
c.Torso.Transparency = .8
c.Head.Transparency = .8
c["Right Arm"].Transparency = .8
c["Left Arm"].Transparency = .8
c["Right Leg"].Transparency = .8
c["Left Leg"].Transparency = .8
end
end)
end)
end)
Report Abuse
KodakKid3 is not online. KodakKid3
Joined: 25 Dec 2008
Total Posts: 2860
14 Mar 2014 05:19 PM
The script looks long and stuff, but it's really very basic.
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
14 Mar 2014 05:28 PM
local passId = 149612481

game.Players.PlayerAdded:connect(function(p)
p.CanLoadCharacterAppearance = false
p.CharacterAdded:connect(function(c)
c.Torso.BrickColor = BrickColor.new("Dark stone grey")
c.Head.BrickColor = BrickColor.new("Institutional white")
c["Right Arm"].BrickColor = BrickColor.new("Institutional white")
c["Left Arm"].BrickColor = BrickColor.new("Institutional white")
c["Right Leg"].BrickColor = BrickColor.new("Dark stone grey")
c["Left Leg"].BrickColor = BrickColor.new("Dark stone grey")
c.Head.face.Texture = "http://www.roblox.com/asset/?id=8560915"
if game:GetService("GamePassService"):PlayerHasPass(player, passId) then
for i,v in pairs(c:GetChildren()) do
if v:IsA("BasePart") then
v.Transparency = .8
elseif v:IsA("Hat") then
v.Handle.Transparency = .8
end end end end end)
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
14 Mar 2014 05:28 PM
There is probably a better way however, this should fix it.

game.Players.PlayerAdded:connect(function(p)
p.CanLoadCharacterAppearance = false
p.CharacterAdded:connect(function(c)
if isAuthenticated(p) then
c.Torso.BrickColor = BrickColor.new("Dark stone grey")
c.Head.BrickColor = BrickColor.new("Institutional white")
c["Right Arm"].BrickColor = BrickColor.new("Institutional white")
c["Left Arm"].BrickColor = BrickColor.new("Institutional white")
c["Right Leg"].BrickColor = BrickColor.new("Dark stone grey")
c["Left Leg"].BrickColor = BrickColor.new("Dark stone grey")
c.Head.face.Texture = "http://www.roblox.com/asset/?id=8560915"
--
c.Torso.Transparency = .8
c.Head.Transparency = .8
c["Right Arm"].Transparency = .8
c["Left Arm"].Transparency = .8
c["Right Leg"].Transparency = .8
c["Left Leg"].Transparency = .8
else
c.Torso.BrickColor = BrickColor.new("Dark stone grey")
c.Head.BrickColor = BrickColor.new("Institutional white")
c["Right Arm"].BrickColor = BrickColor.new("Institutional white")
c["Left Arm"].BrickColor = BrickColor.new("Institutional white")
c["Right Leg"].BrickColor = BrickColor.new("Dark stone grey")
c["Left Leg"].BrickColor = BrickColor.new("Dark stone grey")
c.Head.face.Texture = "http://www.roblox.com/asset/?id=8560915"
end
end)
end)

function isAuthenticated(player)
return game:GetService("GamePassService"):PlayerHasPass(player, passId)
end
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
14 Mar 2014 05:29 PM
Gouls looks kinda ugly,but its shorter,and should work
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
14 Mar 2014 05:30 PM
@duel
The function isAuthenticated
Should be defined BEFORE it says (if isAuthenticated(p)
Otherwise,it'll say its nil
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
14 Mar 2014 05:34 PM
no it looks for the function
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
14 Mar 2014 05:37 PM
...
hi()
function hi()
print"hi"
end

Cmon now,that function is nil,unless you define it FIRST

function hi()
print"hi"
end
hi()
will work..
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
14 Mar 2014 05:40 PM
Woops, sorry, I've been working with java, forgot it went that way with Lua.
Report Abuse
KodakKid3 is not online. KodakKid3
Joined: 25 Dec 2008
Total Posts: 2860
14 Mar 2014 05:40 PM
Thanks, but neither worked (Though goul's didn't break anything either).

qq
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
14 Mar 2014 05:41 PM
change "player" in goul's to "p"
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
14 Mar 2014 05:42 PM
In gouls change:
if game:GetService("GamePassService"):PlayerHasPass(player, passId) then
To:
if game:GetService("GamePassService"):PlayerHasPass(p, passId) then
Report Abuse
KodakKid3 is not online. KodakKid3
Joined: 25 Dec 2008
Total Posts: 2860
14 Mar 2014 05:48 PM
Thanks Dueling, that worked :)

Now I'll need to get it to just change the legs and torso to Institutional white as well. (Only if you have pass)
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
14 Mar 2014 08:21 PM
Lol why are you thanking him it's my script! x)
Report Abuse
KodakKid3 is not online. KodakKid3
Joined: 25 Dec 2008
Total Posts: 2860
14 Mar 2014 08:43 PM
Just that it worked.

ANy idea how I could get it to change the player's torso and legs to Institutional white as well if you have the gamepass?
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
14 Mar 2014 10:08 PM
Change the NrickColor String Value to ("Institutional White") instead of ("Dark stone grey")
Report Abuse
KodakKid3 is not online. KodakKid3
Joined: 25 Dec 2008
Total Posts: 2860
14 Mar 2014 10:19 PM
Well, I want it to stay dark stone gray, but if you have the transparency gamepass, make it white.
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
15 Mar 2014 09:50 PM
Then put the Dark Stone Grey BrickColor method outside the if statement for checking the gamepass and the Institutional White BrickColor method inside.
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