So I keep getting this error "attempt to call a table value" and I know its probably a stupid mistake but I really don't understand what to do, this is my code
local punchSounds = {"rbxassetid://1193237596", "rbxassetid://1033173157", "rbxassetid://131237241", "rbxassetid://3064939784"} -- this is the variable set before the other line
local punchSound = Instance.new("Sound")
punchSound.SoundId = punchSounds(math.random(1, 4)) -- the line thats messing up
punchSound.Volume = 1
punchSound.Parent = script.Parent:FindFirstChild("Right Arm")
punchSound.Name = "punch"
punchSound:Play()

1 comment
it worked! thanks dude!