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
 

Re: Help!

Previous Thread :: Next Thread 
SenseiMuddy is not online. SenseiMuddy
Joined: 20 Jan 2013
Total Posts: 183
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
SenseiMuddy is not online. SenseiMuddy
Joined: 20 Jan 2013
Total Posts: 183
28 Jan 2013 12:54 AM
I'm gonna keep bumping until you noobs stop neglecting me.
Report Abuse
Usering is not online. 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
RoboTestGear is not online. RoboTestGear
Joined: 28 Dec 2009
Total Posts: 3063
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
RoboTestGear is not online. RoboTestGear
Joined: 28 Dec 2009
Total Posts: 3063
28 Jan 2013 03:29 AM
opps,

if gold.Value <= 3 then
Report Abuse
Kelvin98 is not online. Kelvin98
Joined: 14 Dec 2008
Total Posts: 272
28 Jan 2013 06:10 AM
if gold.Value > 2 then
Report Abuse
SenseiMuddy is not online. SenseiMuddy
Joined: 20 Jan 2013
Total Posts: 183
28 Jan 2013 08:18 PM
I fixed it myself before you replied by changing the whole design of the shop model.
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