fire243
|
  |
| Joined: 04 Apr 2010 |
| Total Posts: 6532 |
|
|
| 29 Nov 2013 06:15 PM |
function onClicked(GUI) a = script.Parent.Parent.Parent.Parent.Parent b = a:FindFirstChild("leaderstats") if b ~= nil then c = b:FindFirstChild("KOs") if c.Value >= 30 then c.Value = c.Value - 30 local hu = player.Character:findFirstChild("Humanoid") local t = player.Character:findFirstChild("Torso") local h = player.Character:findFirstChild("Head") local la = player.Character:findFirstChild("Left arm") local ra = player.Character:findFirstChild("Right arm") local ll = player.Character:findFirstChild("Left leg") local rl = player.Character:findFirstChild("Right leg") t.BrickColor = BrickColor.new("Medium stone grey") h.BrickColor = BrickColor.new("Dark stone grey") la.BrickColor = BrickColor.new("Medium stone grey") ra.BrickColor = BrickColor.new("Medium stone grey") ll.BrickColor = BrickColor.new("Medium stone grey") rl.BrickColor = BrickColor.new("Medium stone grey") hu.WalkSpeed = 35 if c.Value < 30 then script.Parent.Text = "You dont have enough credits" wait(3) script.Parent.Text = "I want the silver suit" end end end end
script.Parent.MouseButton1Click:connect(onClicked) |
|
|
| Report Abuse |
|
|
fire243
|
  |
| Joined: 04 Apr 2010 |
| Total Posts: 6532 |
|
| |
|
fire243
|
  |
| Joined: 04 Apr 2010 |
| Total Posts: 6532 |
|
| |
|
fire243
|
  |
| Joined: 04 Apr 2010 |
| Total Posts: 6532 |
|
| |
|
fire243
|
  |
| Joined: 04 Apr 2010 |
| Total Posts: 6532 |
|
| |
|
fire243
|
  |
| Joined: 04 Apr 2010 |
| Total Posts: 6532 |
|
|
| 29 Nov 2013 06:20 PM |
| i thought this was scripting helpers |
|
|
| Report Abuse |
|
|
fire243
|
  |
| Joined: 04 Apr 2010 |
| Total Posts: 6532 |
|
| |
|
fire243
|
  |
| Joined: 04 Apr 2010 |
| Total Posts: 6532 |
|
| |
|
fire243
|
  |
| Joined: 04 Apr 2010 |
| Total Posts: 6532 |
|
| |
|
fire243
|
  |
| Joined: 04 Apr 2010 |
| Total Posts: 6532 |
|
| |
|
fire243
|
  |
| Joined: 04 Apr 2010 |
| Total Posts: 6532 |
|
| |
|
fire243
|
  |
| Joined: 04 Apr 2010 |
| Total Posts: 6532 |
|
| |
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 29 Nov 2013 06:25 PM |
You used another if statement rather than elseif, try this.
--Put in a local script
local a = game.Players.LocalPlayer local c = a.Character local hu = c.Humanoid local b = a:FindFirstChild("leaderstats")
function onClicked(GUI) if b then c = b:FindFirstChild("KOs") if c.Value >= 30 then c.Value = c.Value - 30 for i,v in pairs(a.Character:GetChildren()) do if v:IsA("Part") then if v.Name ~= "Head" then v.BrickColor = BrickColor.new("Medium stone grey") else v.BrickColor = BrickColor.new("Dark stone grey") end end end hu.WalkSpeed = 35 elseif c.Value < 30 then script.Parent.Text = "You dont have enough credits" wait(3) script.Parent.Text = "I want the silver suit" end end end
script.Parent.MouseButton1Click:connect(onClicked) |
|
|
| Report Abuse |
|
|
fire243
|
  |
| Joined: 04 Apr 2010 |
| Total Posts: 6532 |
|
| |
|
| |
|
fire243
|
  |
| Joined: 04 Apr 2010 |
| Total Posts: 6532 |
|
| |
|
fire243
|
  |
| Joined: 04 Apr 2010 |
| Total Posts: 6532 |
|
|
| 29 Nov 2013 06:31 PM |
@azarth didnt work @whatsurface output says nothing |
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 29 Nov 2013 06:33 PM |
add a print("leaderstats are there") after if b then
If you're testing in solo, then playerAdded isn't going to work, therefore leaderstats aren't going in your player. |
|
|
| Report Abuse |
|
|
fire243
|
  |
| Joined: 04 Apr 2010 |
| Total Posts: 6532 |
|
|
| 29 Nov 2013 06:41 PM |
| ah ok i am testing in solo |
|
|
| Report Abuse |
|
|