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 » Roblox » All Things ROBLOX
Home Search
 

Re: Script help -- Please!!!

Previous Thread :: Next Thread 
silverswordgold2 is not online. silverswordgold2
Joined: 02 Sep 2011
Total Posts: 1598
29 Jun 2013 02:07 PM
It's supposed to kill the player that touches it, give it 500 Cash, say it won, and change the bricks transparency to 0.

function onTouch(part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
if (humanoid ~= nil) then
humanoid.Health = 0
local user = game.Players:GetPlayerFromCharacter(hit.Parent)
local stats = user:findFirstChild("leaderstats")
if stats ~= nil then
local cash = stats:findFirstChild("Cash")
cash.Value = cash.Value + 500
wait()
print("Player won!")
wait()
local h = Instance.new("Message")
h.Parent = game.Workspace
h.Text = "" .. user.Name .. " Has Reached The Finish Line And Won 1st Place! Awarding 500 Coins..."
wait(2.5)
h:remove()
wait(3)
script.Parent.Parent.FinishLine.Transparency = 0
wait(2)
script.Parent.Parent:remove()
end
end
end

script.Parent.Touched:connect(onTouch)

Sorry to be in the wrong topic, But i need help fast!
Report Abuse
silverswordgold2 is not online. silverswordgold2
Joined: 02 Sep 2011
Total Posts: 1598
29 Jun 2013 02:10 PM
bump
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
29 Jun 2013 02:12 PM
Does all the stuff you defined in there exist? No output either? Are you sure it's Cash not Money or something else?

~ The ATR Fishie ~
Report Abuse
GuestLieAlt is not online. GuestLieAlt
Joined: 24 Jun 2012
Total Posts: 1107
29 Jun 2013 02:12 PM
Go to youtube and watch stickmasterluke's scripting tutorials
Report Abuse
guy999p is not online. guy999p
Joined: 01 Dec 2008
Total Posts: 2749
29 Jun 2013 02:13 PM
Lol your are going to use this to exploit arnt you.
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
29 Jun 2013 02:13 PM
^
Do anything but that

~ The ATR Fishie ~
Report Abuse
Wesker6543 is not online. Wesker6543
Joined: 09 Jan 2011
Total Posts: 17125
29 Jun 2013 02:13 PM
[ Content Deleted ]
Report Abuse
silverswordgold2 is not online. silverswordgold2
Joined: 02 Sep 2011
Total Posts: 1598
29 Jun 2013 02:13 PM
I cant run it in RBLX studio because it gives you no leaderboard in roblox studio test.

It tops working when it gets to where it gives the Cash. And yes, there is a Cash leaderboard.
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
29 Jun 2013 02:14 PM
Alright. You can't run it in play solo?

Test > Play Solo
or
F6 I think

then you'd have your output.

~ The ATR Fishie ~
Report Abuse
silverswordgold2 is not online. silverswordgold2
Joined: 02 Sep 2011
Total Posts: 1598
29 Jun 2013 02:15 PM
I can, but the leaderboard doesn't load in test solo mode.
Report Abuse
ufo973 is not online. ufo973
Joined: 14 Apr 2009
Total Posts: 20414
29 Jun 2013 02:16 PM
If it's Local User then i think it should work.

~ When the rest of ATR is being Stupid, I'm still here to Help ~
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
29 Jun 2013 02:18 PM
No I believe I've seen the problem.

"function onTouch(part)"

You are passing this argument "part" but it never shows up in the code. What does show up is "local user = game.Players:GetPlayerFromCharacter(hit.Parent)"

"hit". In the first line make part hit. I'm going to check real quick and make sure the argument in the function returns the part that touched it, but I believe I've found your error.

~ The ATR Fishie ~
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
29 Jun 2013 02:19 PM
I'll debug it entirely. It has some other problems.

~ The ATR Fishie ~
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
29 Jun 2013 02:21 PM
What's with all the deprecated methods.
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
29 Jun 2013 02:25 PM
function onTouch(part)

if part.Parent:FindFirstChild("Humanoid") then
local humanoid = part.Parent:FindFirstChild("Humanoid")
humanoid.Health = 0

local user = game.Players:GetPlayerFromCharacter(part.Parent)
local stats = user:findFirstChild("leaderstats")

if stats then
local cash = stats:FindFirstChild("Cash")
cash.Value = cash.Value + 500
end

local h = Instance.new("Message")
h.Parent = workspace
h.Text = "" .. user.Name .. " Has Reached The Finish Line And Won 1st Place! Awarding 500 Coins..."
wait(2.5)
h:Destroy() -- when this was made destroy wasn't made yet. Destroy is better
wait(3)
script.Parent.Parent.FinishLine.Transparency = 0
wait(2)
script.Parent.Parent:Destroy()
end
end

I think that is correct

~ The ATR Fishie ~
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
29 Jun 2013 02:26 PM
@evolved
this code was made a long time ago for those buttons at the end of obbies at tycoons. :remove() is the only one that is deprecated, and that sounds like something off of the wiki.

~ The ATR Fishie ~
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
29 Jun 2013 02:30 PM
k
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Roblox » All Things ROBLOX
   
 
   
  • 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