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: Script debug [Not doing what I need it to do]

Previous Thread :: Next Thread 
Starify is not online. Starify
Joined: 21 Jul 2013
Total Posts: 5606
09 Aug 2013 11:43 AM
script.Parent.Touched:connect(function(collision)
local player = false;

pcall(function()
if (game.Players:GetPlayerFromCharacter(collision.Parent)) then
player = game.Players:GetPlayerFromCharacter(collision.Parent)
end
end)

if (player) then
script.Parent.BrickColor = player.TeamColor
for _, v in pairs(player.leaderstats:GetChildren()) do
if (v:IsA('IntValue')) then
v.Value = 0
end
end
end
end)

-------------------------------------
What is supposed to do, when you touch it, it does the following things:
- Resets your leaderboardstats (KOs, Wipeouts) values to 0
- Changes your team to the color of the brick (Say, if the brick color was blue, your team would be changed to the blue team)
- Respawns your character without gaining a wipeout

So far, only the first one is working. (Reseting leaderboardstats)

★ [ TSC Imperator Starify ] ★
Report Abuse
Xtreme101 is not online. Xtreme101
Joined: 03 Jan 2009
Total Posts: 4385
09 Aug 2013 11:49 AM
Output?
Report Abuse
tummey2 is not online. tummey2
Joined: 04 Feb 2009
Total Posts: 1802
09 Aug 2013 11:50 AM
Why are you running in pcall? You're not going to get any output if you do that...
Report Abuse
Starify is not online. Starify
Joined: 21 Jul 2013
Total Posts: 5606
09 Aug 2013 11:50 AM
12:31:55.014 - DataModel Loading http://www.roblox.com/asset/?id=125457533
logging probability 0.58494827112644
not logging
12:36:31.394 - Auto-Saving...
12:41:31.852 - Auto-Saving...
12:46:31.748 - Auto-Saving...
> script.Parent.Touched:connect(function(collision)
local player = false;
pcall(function()
if (game.Players:GetPlayerFromCharacter(collision.Parent)) then
player = game.Players:GetPlayerFromCharacter(collision.Parent)
end
end)
if (player) then
script.Parent.BrickColor = player.TeamColor
for _, v in pairs(player.leaderstats:GetChildren()) do
if (v:IsA('IntValue')) then
v.Value = 0
end
end
end
end)
12:50:03.282 - script.Parent.Touched:connect(function(collision)
local pl:1: attempt to index global 'script' (a nil value)
12:50:03.289 - Script "script.Parent.Touched:connect(function(collision)
local pl", Line 1
12:50:03.289 - stack end

★ [ TSC Imperator Starify ] ★
Report Abuse
Xtreme101 is not online. Xtreme101
Joined: 03 Jan 2009
Total Posts: 4385
09 Aug 2013 11:53 AM
You're trying to run this script through a command? That's not going to do anything...
Report Abuse
Starify is not online. Starify
Joined: 21 Jul 2013
Total Posts: 5606
09 Aug 2013 11:54 AM
No, I'm trying to run in through a script in a brick..

★ [ TSC Imperator Starify ] ★
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