print("Badge Awarder Loaded. BadgeID: " .. script.BadgeID.Value) function OnTouch(part) if (part.Parent:FindFirstChild("Humanoid") ~= nil) then local p = game.Players:GetPlayerFromCharacter(part.Parent) if (p ~= nil) then print("Awarding BadgeID: " ..script.BadgeID.Value .. " to UserID: " .. p.userId) local b = game:GetService("BadgeService") b:AwardBadge(p.userId, script.BadgeID.Value) end end end script.Parent.Touched:connect(OnTouch)
I have this script in my game but it gives me an error
Touched is not a valid member of LocalScript
Any idea how to fix it?