|
| 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 |
|
|
|
| 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
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 05 Apr 2014 05:46 PM |
| Debounce does nothing here. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|