Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

attempt to index local 'left' (a nil value) works if i use humanoid but not a limb?

Asked by
Darpal 1
5 years ago

local ReplicatedStorage = game:GetService("ReplicatedStorage") local createPartRequest = ReplicatedStorage:WaitForChild("puncher") local finna = ReplicatedStorage:WaitForChild("damage") local player = game.Players.LocalPlayer local char = player.Character local hum = char:WaitForChild('Humanoid') local left = hum:FindFirstChild("LeftHand") function onKeyPress(inputObject, gameProcessedEvent) if inputObject.KeyCode == Enum.KeyCode.E then local newPart = createPartRequest:InvokeServer() end end game:GetService("UserInputService").InputBegan:connect(onKeyPress) left.Touched:Connect(function(hits) if hits.Parent:FindFirstChild('Humanoid') then local target = hits.Parent:FindFirstChild('Humanoid') local newthing = finna:InvokeServer(target) end end)

dunno whats wrong but it works if i use humanoid instead of the left hand and i kinda wanna use the left hand but idk how to fix

0
r6 or r15, also why there 2 spaces between local and left DinozCreates 1070 — 5y
0
r15 i got rid of the extra space between local and left but its still says the same thing Darpal 1 — 5y

Answer this question