|
| 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 |
|
|
|
| 15 Jul 2013 08:18 AM |
ye or ne
ProfitableWin, The winning LMaD noob. |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 12 Nov 2011 |
| Total Posts: 582 |
|
|
| 15 Jul 2013 08:19 AM |
| That script would work, yours would not. |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2013 08:26 AM |
Thanks
ProfitableWin, The winning LMaD noob. |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 12 Nov 2011 |
| Total Posts: 582 |
|
| |
|
|
| 15 Jul 2013 10:34 AM |
None of those worked.
ProfitableWin, The winning LMaD noob. |
|
|
| Report Abuse |
|
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|
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
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|
|
| 15 Jul 2013 10:44 AM |
still none worked
ProfitableWin, The winning LMaD noob. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|
|
| 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 |
|
|
|
| 15 Jul 2013 10:47 AM |
| Play Solo doesn't load leaderboards, so that maybe your problem. |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2013 10:47 AM |
| Wait, what's the name of the stat on leaderboard? |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2013 10:48 AM |
Cash
ProfitableWin, The winning LMaD noob. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 15 Jul 2013 12:48 PM |
trying xiao's now. all else failed.
ProfitableWin, The winning LMaD noob. |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2013 12:50 PM |
Everything here failed
ProfitableWin, The winning LMaD noob. |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2013 01:23 PM |
bump
ProfitableWin, The winning LMaD noob. |
|
|
| Report Abuse |
|
|
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 |
|
|