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

"Touched is not a valid member of Model "Workspace. ""?

Asked by 2 years ago

When i add my badge script is says "Touched is not a valid member of Model "Workspace. "" this is my script:

local BadgeService = game:GetService("BadgeService")
local Players = game:GetService("Players")

local Part = script.Parent
local IDToAward = 2129399776

local debounce = true

Part.Touched:Connect(function(Hit)
    local Player = Players:GetPlayerFromCharacter(Hit.Parent)
    if not Player or BadgeService:UserHasBadgeAsync(Player.UserId, IDToAward) or not debounce then
        return
    end
    debounce = false
    BadgeService:AwardBadge(Player.UserId, IDToAward)
    wait(5)
    debounce = true
end)

0
Where is your script located NykoVania 231 — 2y
0
inside the thing im trying to touch PeterParker17386 16 — 2y
0
Can you do Print(Part.Name) and tell me the output? NykoVania 231 — 2y
0
Try script.Parent.Touched if your directory is being mixed up with others on accident. manith513 121 — 2y

Answer this question