Hi! I have a tiny issue with my game producing this “InteralServerError” on functions that are encoded into roblox like the Touched event or the Humanoid.Died event. When trying to get the arguments from these encoded functions, they error like crazy.
This is game-breaking. I am losing players due to this.
Please help me!
Some code from these errors:
pad.Touched:Connect(function(obj)
local plr = game.Players:GetPlayerFromCharacter(obj.Parent)
if plr and debounce == true then
if BadgeId.Value ~= 0 then
if not BadgeService:UserHasBadgeAsync(plr.UserId, BadgeId.Value) then
return
end
end
debounce = false
local charClone = character:Clone()
charClone.HumanoidRootPart.Anchored = false
charClone.Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.Subject
charClone.Humanoid.HealthDisplayType = Enum.HumanoidHealthDisplayType.DisplayWhenDamaged
charClone.Humanoid.MaxHealth = 150
charClone.Humanoid.Health = 150
charClone.Name = plr.DisplayName
plr.Character = charClone
local rootPart = charClone:FindFirstChild("HumanoidRootPart") or charClone:FindFirstChild("Torso")
local plrRoot = obj.Parent:FindFirstChild("HumanoidRootPart") or obj.Parent:FindFirstChild("Torso")
if rootPart and plrRoot then
rootPart.CFrame = plrRoot.CFrame
end
charClone.Parent = workspace
giveItems(plr)
wait(1)
debounce = true
plr:FindFirstChild("leaderstats"):FindFirstChild("Team").Value = string.sub(pad.Parent.Name, 5, #pad.Parent.Name)
end
end)
No reason to error like they are