|
| 17 Dec 2013 10:12 AM |
It look fine but i doesnt clone the sword into the backpack heres the script:
player = script.Parent.Parent.Parent.Parent.Parent cost = 500
function checkForSword() found = false for i, v in pairs(player.Backpack:GetChildern()) do if v.Name == "Sword" then found = true end end for i, v in pairs(player.Character:GetChildern()) do if v.Name == "Sword" then found = true end end
if found == true then return true else return false end end
script.Parent.MouseButton1Click:connect(function() leaderstats = player:FindFirstChild("leaderstats") if leaderstats then points = leaderstats:FindFirstChild("Points") if points then hasSword = checkForSword() if points.Value >= cost and hasSword == false then sword = game.Lighting.Sword:Clone() sword.Parent = player.Backpack end end end end)
|
|
|
| Report Abuse |
|
|
|
| 17 Dec 2013 10:23 AM |
Did i spell something wrong or?
-LMaD's Yellow Flash- |
|
|
| Report Abuse |
|
|
|
| 17 Dec 2013 10:32 AM |
did i miss something??
-LMaD's Yellow Flash- |
|
|
| Report Abuse |
|
|
ForceSky
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 2379 |
|
|
| 17 Dec 2013 10:37 AM |
| the returns should be in the function bro |
|
|
| Report Abuse |
|
|
Dmoney433
|
  |
| Joined: 31 Dec 2010 |
| Total Posts: 3903 |
|
|
| 17 Dec 2013 10:37 AM |
for i, v in pairs(player.Backpack:GetChildern()) do if v.Name == "Sword" then found = true end end for i, v in pairs(player.Character:GetChildern()) do
Check your spelling on Children and that should fix it :) |
|
|
| Report Abuse |
|
|
|
| 17 Dec 2013 10:43 AM |
oops thank you dmoney it works!
-LMaD's Yellow Flash- |
|
|
| Report Abuse |
|
|
Dmoney433
|
  |
| Joined: 31 Dec 2010 |
| Total Posts: 3903 |
|
| |
|