My script where ur arm gets hardened works in studio but not in game.. Why does this happen?
Asked by
8 years ago Edited 8 years ago
This does not work in game but in studio it works
perfectly.. Idk what's wrong I've tried many solutions but idk...
BTW, ITS A LOCALSCRIPT.
PROBLEM:
When I check in game logs
I see something about the data model (client log)
"attempt to index local "char"
PLZ HELP!
01 | Players = game.Players.LocalPlayer |
02 | mouse = Players:GetMouse() |
03 | local char = Players.Character |
04 | local torso = char:findFirstChild( "Torso" ) |
05 | local leftarm = char:findFirstChild( "Left Arm" ) |
09 | function onKeyDown(key) |
12 | local part = char [ "Left Arm" ] :Clone() |
13 | part.BrickColor = BrickColor.new( "Institutional white" ) |
14 | part.Material = "Neon" |
15 | part.Name = "LeftArm2" |
16 | part.CFrame = leftarm.CFrame |
18 | part.CanCollide = false |
22 | part.Size = part.Size +Vector 3. new( 0.1 , 0.1 , 0.1 ) |
23 | part.Transparency = part.Transparency + 0.1 |
24 | part.CFrame = leftarm.CFrame |
29 | leftarm.BrickColor = BrickColor.new( 'Really black' ) |
30 | leftarm.Material = 'Neon' |
31 | leftarm.Reflectance = 0.1 |
32 | torso.Anchored = false |
38 | mouse.KeyDown:connect(onKeyDown) |