|
| 28 Jan 2013 12:50 AM |
I am still a newbie scripter, so I still scavenge scripts from Free Models and fuse parts of them together. All of my scripts have worked eventually (Less than 10 attempts), except the script for the shop. Can someone fix it?
The whole script
---------------------------------------------------------------------------------------- local debounce = false
function getPlayer(humanoid) local players = game.Players:children() for i = 1, #players do if players[i].Character.Humanoid == humanoid then return players[i] end end return nil end
function onTouch(part)
check = hit.Parent:FindFirstChild("Humanoid")
if check ~= nil then
local user = game.Players:GetPlayerFromCharacter(hit.Parent) local stats = user:findFirstChild("leaderstats")
if stats ~= nil then local gold = stats:findFirstChild("Gold") if gold.value =< 3 then
local human = part.Parent:findFirstChild("Humanoid") if (human ~= nil) and debounce == false then
debounce = true
local player = getPlayer(human)
if (player == nil) then return end
script.Parent:clone().Parent = player.Backpack
wait(2) debounce = false end end
script.Parent.Parent.Touched:connect(onTouch) ----------------------------------------------------------------------------------- I want a giver that gives the player a sword, but only if they have enough captures. What it does is behave like a regular brick and do nothing whatsoever.
This is the bit of the script that is broken ------------------------------------------------------- function onTouch(part)
check = hit.Parent:FindFirstChild("Humanoid")
if check ~= nil then
local user = game.Players:GetPlayerFromCharacter(hit.Parent) local stats = user:findFirstChild("leaderstats")
if stats ~= nil then local gold = stats:findFirstChild("Gold") if gold.value =< 3 then ------------------------------------------------------------
Don't want to help because I'm using free models?
Stravant said-Making small changes to those models to see what works and what doesn't, and building up more and more complex changes as you go.
|
|
|
| Report Abuse |
|
|
|
| 28 Jan 2013 12:54 AM |
| I'm gonna keep bumping until you noobs stop neglecting me. |
|
|
| Report Abuse |
|
|
Usering
|
  |
| Joined: 18 Aug 2012 |
| Total Posts: 10281 |
|
|
| 28 Jan 2013 01:01 AM |
>calls us noobs
-100 respect no help
[ Content Trolled by Sorcus ] |
|
|
| Report Abuse |
|
|
|
| 28 Jan 2013 03:28 AM |
if gold.Value =< 3 then
--[[ Note; I'm not sure if it has to be Value or not, but I always capitalize it. Try that and tell me the output if it errors. ]] |
|
|
| Report Abuse |
|
|
|
| 28 Jan 2013 03:29 AM |
opps,
if gold.Value <= 3 then
|
|
|
| Report Abuse |
|
|
Kelvin98
|
  |
| Joined: 14 Dec 2008 |
| Total Posts: 272 |
|
| |
|
|
| 28 Jan 2013 08:18 PM |
| I fixed it myself before you replied by changing the whole design of the shop model. |
|
|
| Report Abuse |
|
|