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: Need help with a faulty line in this script;

Previous Thread :: Next Thread 
Tanker273Backup is not online. Tanker273Backup
Joined: 17 Aug 2012
Total Posts: 56
05 Apr 2014 05:42 PM
To start, I am trying to write a script that assigns a variable the name of the player that touched it then gives the person a NumberValue tag then gives them mesh parts. Everything in my script is fully functional except for the part in which the player's name is assigned to the external variable. The script just seems to skip over the part where it assigned the touching player's name to the external variable. I tried manually inserting the 'Player1' name when I was using the Play Solo feature and it worked fine.

local bin = script.Parent
local hitName = script.TouchName.Value

local PlayerFind = game.Workspace:FindFirstChild(hitName) *This works*

function addMesh() *All this works. Go to the next function block.*
print ("AddiingSpecialMeshParts")
local b = game.Lighting.BomboLeftArm:clone()
b.Parent = (PlayerFind)
local c = game.Lighting.BomboRightArm:clone()
c.Parent = (PlayerFind)
local d = game.Lighting.BomboLeftLeg:clone()
d.Parent = (PlayerFind)
local e = game.Lighting.BomboRightLeg:clone()
e.Parent = (PlayerFind)
local f = game.Lighting.BomboTorso:clone()
f.Parent = (PlayerFind)
end

function touched(object)
if object.Parent:FindFirstChild("Humanoid") == nil then return end
debounce = true
hitName = object.Name <*********Here is my issue. This doesn't work*****
local a = Instance.new("NumberValue", object.Parent.Torso)
a.Name = "IsMM?"
a.Value = 1 --This is for later use
wait (0.1)
addMesh()
wait (0.9)
debounce = false
end

script.Parent.Touched:connect(touched)

Also, am I using the debounce feature correctly?
Any possible ideas on how do address the issue as such?
Report Abuse
JigglingJack is not online. JigglingJack
Joined: 25 Mar 2014
Total Posts: 11263
05 Apr 2014 05:44 PM
1.) Debounce in your script is useless
2.)Humanoid's Name will be humanoid unless you change it

i'm asian
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
05 Apr 2014 05:46 PM
Debounce does nothing here.
Report Abuse
Tanker273Backup is not online. Tanker273Backup
Joined: 17 Aug 2012
Total Posts: 56
05 Apr 2014 05:48 PM
I tried using debounce to cancel out constant repetition of the script as long as a player is touching it for a short time. I should just remove it or is there a better way to do this?
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