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
 

[ Content Deleted ]

Previous Thread :: Next Thread 
ProfitableWin is not online. ProfitableWin
Joined: 17 Aug 2012
Total Posts: 18132
15 Jul 2013 08:12 AM
I want it so that it kill you but adds 100 points to the tycoon leader board, would this work?
function OnTouch(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
hit.Parent.Humanoid.Health = 0
end
end

script.Parent.Touched:connect(OnTouch)

function OnTouch(hit)
local humanoid = hit.Parent:FindFirstChild ("humanoid")
if humanoid then
hit.Parent.Humanoid.Value + 100
end
end

script.Parent.Touched:connect(OnTouch)
Report Abuse
ProfitableWin is not online. ProfitableWin
Joined: 17 Aug 2012
Total Posts: 18132
15 Jul 2013 08:18 AM
ye or ne

ProfitableWin, The winning LMaD noob.
Report Abuse
sam8985 is not online. sam8985
Joined: 12 Nov 2011
Total Posts: 582
15 Jul 2013 08:19 AM
local debounce = true
function OnTouch(hit)
if debounce == true then
local debounce = false
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
humanoid.Health = 0
stats = game.Players:GetPlayerFromCharacter(humanoid.Parent):FindFirstChild("leaderstats")
if stats then
stats.Points.Value = stats.Points.Value + 100
wait(2)
local debounce = true
end
end
end
end

script.Parent.Touched:connect(OnTouch)
Report Abuse
sam8985 is not online. sam8985
Joined: 12 Nov 2011
Total Posts: 582
15 Jul 2013 08:19 AM
That script would work, yours would not.
Report Abuse
ProfitableWin is not online. ProfitableWin
Joined: 17 Aug 2012
Total Posts: 18132
15 Jul 2013 08:26 AM
Thanks

ProfitableWin, The winning LMaD noob.
Report Abuse
mrmrluaa3 is not online. mrmrluaa3
Joined: 25 Jun 2013
Total Posts: 122
15 Jul 2013 08:39 AM
function OnTouch(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
humanoid.Health = 0
end
end

script.Parent.Touched:connect(OnTouch)

function OnTouch(hit)
local humanoid = hit.Parent:FindFirstChild ("Humanoid")
if humanoid then
Humanoid.Value = Humanoid.Value + 100
end
end

script.Parent.Touched:connect(OnTouch)
Report Abuse
sam8985 is not online. sam8985
Joined: 12 Nov 2011
Total Posts: 582
15 Jul 2013 08:49 AM
@above
Hell no.
Report Abuse
ProfitableWin is not online. ProfitableWin
Joined: 17 Aug 2012
Total Posts: 18132
15 Jul 2013 10:34 AM
None of those worked.

ProfitableWin, The winning LMaD noob.
Report Abuse
baheeg is not online. baheeg
Joined: 19 Jul 2010
Total Posts: 72846
15 Jul 2013 10:38 AM
[ Content Deleted ]
Report Abuse
cxcharlie is not online. cxcharlie
Joined: 26 Aug 2009
Total Posts: 1414
15 Jul 2013 10:39 AM
function OnTouch(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid~= nil then
humanoid.Health = 0
end
end

script.Parent.Touched:connect(OnTouch)

function OnTouch(hit)
local humanoid = hit.Parent:FindFirstChild ("humanoid")
if humanoid ~= nil then
humanoid.MaxHealth = humanoid.MaxHealth+100
humanoid.Health = humanoid.Health+100

end
end

script.Parent.Touched:connect(OnTouch)
Report Abuse
baheeg is not online. baheeg
Joined: 19 Jul 2010
Total Posts: 72846
15 Jul 2013 10:39 AM
[ Content Deleted ]
Report Abuse
ProfitableWin is not online. ProfitableWin
Joined: 17 Aug 2012
Total Posts: 18132
15 Jul 2013 10:44 AM
still none worked

ProfitableWin, The winning LMaD noob.
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
15 Jul 2013 10:44 AM
There's no such thing as a scripting fail. There is only trial and error. If someone tells you that you've failed, they're just being an immature brat.
Report Abuse
baheeg is not online. baheeg
Joined: 19 Jul 2010
Total Posts: 72846
15 Jul 2013 10:45 AM
[ Content Deleted ]
Report Abuse
ProfitableWin is not online. ProfitableWin
Joined: 17 Aug 2012
Total Posts: 18132
15 Jul 2013 10:46 AM
@baheeg
no i leave and play in a actual like server not edit solo

ProfitableWin, The winning LMaD noob.
Report Abuse
yomomma128 is not online. yomomma128
Joined: 13 Nov 2008
Total Posts: 23503
15 Jul 2013 10:47 AM
Play Solo doesn't load leaderboards, so that maybe your problem.
Report Abuse
yomomma128 is not online. yomomma128
Joined: 13 Nov 2008
Total Posts: 23503
15 Jul 2013 10:47 AM
Wait, what's the name of the stat on leaderboard?
Report Abuse
ProfitableWin is not online. ProfitableWin
Joined: 17 Aug 2012
Total Posts: 18132
15 Jul 2013 10:48 AM
Cash

ProfitableWin, The winning LMaD noob.
Report Abuse
yomomma128 is not online. yomomma128
Joined: 13 Nov 2008
Total Posts: 23503
15 Jul 2013 10:49 AM
local debounce = true
function OnTouch(hit)
if debounce == true then
local debounce = false
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
humanoid.Health = 0
stats = game.Players:GetPlayerFromCharacter(humanoid.Parent):FindFirstChild("leaderstats")
if stats then
stats.Points.Value = stats.Cash.Value + 100
wait(2)
local debounce = true
end
end
end
end

just changed 'Points' to 'Cash'
Report Abuse
yomomma128 is not online. yomomma128
Joined: 13 Nov 2008
Total Posts: 23503
15 Jul 2013 10:50 AM
No, do this.

local debounce = true
function OnTouch(hit)
if debounce == true then
local debounce = false
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
humanoid.Health = 0
stats = game.Players:GetPlayerFromCharacter(humanoid.Parent):FindFirstChild("leaderstats")
if stats then
stats.Cash.Value = stats.Cash.Value + 100
wait(2)
local debounce = true
end
end
end
end
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
15 Jul 2013 11:00 AM
DB = 0
script.Parent.Touched:connect(function(hit)
if DB == 0 then
DB = 1
local H = hit.Parent:findFirstChild("Humanoid")
if H ~= nil then
P = game.Players:GetPlayerFromCharacter(hit.Parent)
if P ~= nil then
local S = P:findFirstChild("leaderstats")
if S ~= nil then
H.Health = 0
S.Cash.Value = S.Cash.Value + 100
wait(2)
DB = 0
end end end end end)
Report Abuse
ProfitableWin is not online. ProfitableWin
Joined: 17 Aug 2012
Total Posts: 18132
15 Jul 2013 12:48 PM
trying xiao's now. all else failed.

ProfitableWin, The winning LMaD noob.
Report Abuse
ProfitableWin is not online. ProfitableWin
Joined: 17 Aug 2012
Total Posts: 18132
15 Jul 2013 12:50 PM
Everything here failed

ProfitableWin, The winning LMaD noob.
Report Abuse
ProfitableWin is not online. ProfitableWin
Joined: 17 Aug 2012
Total Posts: 18132
15 Jul 2013 01:23 PM
bump

ProfitableWin, The winning LMaD noob.
Report Abuse
Hergest is not online. Hergest
Joined: 17 May 2011
Total Posts: 309
15 Jul 2013 01:46 PM
Your script would work, but it needs a debounce. You see, once it get touched. It won't give +100 once, but it would keep repeating it.
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