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: Stage changer fail, why doesn't it work?

Previous Thread :: Next Thread 
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
13 Sep 2015 02:00 PM
script.Parent.Touched:connect(function(P)
if P:FindFirstChild("leaderstats") then
print("leaderstats")
if P.leaderstats:FindFirstChild("Stage") then
print("Stage")
if P.leaderstats.Stage.Value > 1 then
P.leaderstats.Stage.Value = P.leaderstats.Stage.Value + 1
end
end
end
end)
Report Abuse
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
13 Sep 2015 02:02 PM
It didn't find the leaderstats nor the stage.
Report Abuse
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
13 Sep 2015 02:03 PM
Is there an item called "leaderstats" in all the body parts of the character?
Report Abuse
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
13 Sep 2015 02:03 PM
No, but it's in the player under the "Players" tab.
Report Abuse
KLGA is not online. KLGA
Joined: 19 Apr 2014
Total Posts: 2571
13 Sep 2015 02:04 PM
The parameter of Touched is the part that touches the object. Assuming you don't have 'leaderstats' stored in the legs or whatever part touches this, you'll have to link it to where leaderstats is stored. I'm assuming it's in the player, so you would do something like this:

script.Parent.Touched:connect(function(P)
if P.Parent:FindFirstChild("Humanoid") then
if game.Players:GetPlayerFromCharacter(P.Parent) then
local pl = game.Players:GetPlayerFromCharacter(P.Parent)
if pl.leaderstats:FindFirstChild("Stage") then
if pl.leaderstats.Stage.Value > 1 then
pl.leaderstats.Stage.Value = pl.leaderstats.Stage.Value + 1
end
end
end
end
end)
Report Abuse
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
13 Sep 2015 02:07 PM
@Kl That didn't work.. It's not stored in the player in workspace, it's stored in the player under the "Players" tab.
Report Abuse
SoapyDishy is not online. SoapyDishy
Joined: 31 Aug 2015
Total Posts: 2169
13 Sep 2015 02:10 PM
script.Parent.Touched:connect(function(P)
if P.Parent:FindFirstChild("leaderstats") then
print("leaderstats")
if P.Parent.leaderstats:FindFirstChild("Stage") then
print("Stage")
if P.Parent.leaderstats.Stage.Value > 1 then
P.Parent.leaderstats.Stage.Value = P.Parent.leaderstats.Stage.Value + 1
end
end
end
end)
Report Abuse
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
13 Sep 2015 02:11 PM
@Soap

Thank you.
Report Abuse
SoapyDishy is not online. SoapyDishy
Joined: 31 Aug 2015
Total Posts: 2169
13 Sep 2015 02:12 PM
No problem my friend. Need more help? Contact me via PM
Report Abuse
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
13 Sep 2015 02:12 PM
Alright, I will.
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