So I am simply creating a function and calling the function whenever a certain dummy's uppertorso,upperleftarm, and upperrightarm are touched. However, I keep getting this error:
"ServerScriptService.Rounds.Round1:33: attempt to index function with 'UpperTorso'"
Not sure what the issue is if anyone can solve it and explain the problem that would be great!
local IR = game.Workspace.GameData.InRound
local RoundNumber = workspace.GameData.RoundNumber
local R1 = game.ReplicatedStorage.Events.Rounds.Round1
--Variables for each customer
local C1 = game.workspace.C1
local humanoid = C1.Humanoid
local pointA = game.Workspace.GreenFlag
local pointB = game.Workspace.PurpleFlag
local pointC = game.Workspace.YellowFlag
--functions for each customer
--Customer1
function C1(hit)
C1 = game.workspace.C1
local humanoid = C1.Humanoid
if hit.Parent.Name == "Pizza" then
local Players = game:GetService("Players")
hit.Parent:Destroy()
--Gives Player Money
for i, player in pairs(Players:GetPlayers()) do
local cash = player.leaderstats.Cash
cash.Value = cash.Value +10
end
humanoid:MoveTo(pointB.PrimaryPart.Position)
humanoid.MoveToFinished:Wait()
humanoid:MoveTo(pointC.PrimaryPart.Position)
end
end
C1.UpperTorso.Touched:Connect(C1)
C1.LeftUpperArm.Touched:Connect(C1)
C1.RightUpperArm.Touched:Connect(C1)

2 comments
Thanks, I also realized that I'm a dummy.
no worries. sometimes you just run into problems in programming. I do all the time lol. when you do, just take a break and come back to it...or you can always ask questions here.