Something Not missing but it is

Hello guys so i was making button that if you click it, it will remove the Aura from player
But for some Reason the scipt cant find The Torso
local Players = game:GetService(“Players”)
local button = Players.LocalPlayer.PlayerGui.EffectCtrl.SettingEf:WaitForChild(“DisInf”)
local enabled = true
print(“First Work”)

local function onCharacterAdded(character)
local Torso = character.Body.Torso
print(“Character Work”)
local Aura = Torso.LeftCollarAttachment.InfernusAura
print(“Second Work”)
button.MouseButton1Click:Connect(function()
Aura.Enabled = enabled
end)
end

local function onPlayerAdded(player)
print(“Player Work”)
player.CharacterAdded:Connect(onCharacterAdded)
if player.Character then
onCharacterAdded(player.Character)
end
end

for _, player in ipairs(Players:GetPlayers()) do
onPlayerAdded(player)
end

Players.PlayerAdded:Connect(onPlayerAdded)

Error: Body is not a valid member of Model “Workspace.IrickingLoveBGS” (IrickingLoveBGS is my other acc)

3 Likes

If the model is R6 then usually the Torso is a direct child.
local Torso = character.Torso
if it’s R15 then it could be UpperTorso, or LowerTorso

formatted:

local Players = game:GetService(“Players”)
local button = Players.LocalPlayer.PlayerGui.EffectCtrl.SettingEf:WaitForChild(“DisInf”)
local enabled = true
print(“First Work”)

local function onCharacterAdded(character)
	local Torso = character.Body.Torso
	print(“Character Work”)
	local Aura = Torso.LeftCollarAttachment.InfernusAura
	print(“Second Work”)
	button.MouseButton1Click:Connect(function()
		Aura.Enabled = enabled
	end)
end

local function onPlayerAdded(player)
	print(“Player Work”)
	player.CharacterAdded:Connect(onCharacterAdded)
	if player.Character then
		onCharacterAdded(player.Character)
	end
end

for _, player in ipairs(Players:GetPlayers()) do
	onPlayerAdded(player)
end

Players.PlayerAdded:Connect(onPlayerAdded)

Error: Body is not a valid member of Model “Workspace.IrickingLoveBGS” (IrickingLoveBGS is my other acc)

2 Likes

oh, my game is R6

Error: Torso is not a valid member of Model “Workspace.IrickingLoveBGS”

So my understanding is… The script cant Find Torso inside the model of the character?

local Torso = character.Body.Torso

The character doesn’t have the instance Body

local Torso = character.Torso should work.

1 Like

i already did that and it gave me another error about Torso is not valid model

Maybe you can check if character true before access it

If character then
-- rest of thw code
end

i always get this error:

Torso is not a valid member of Model “Workspace.IrickingLoveBGS”

NVM:

Try

local Torso = character:WaitForChild("Torso")
1 Like

Now the script found the Torso (Tysm)
but it doesnt disable the effect
Thank Anyways!

Enabled never changes.

	button.MouseButton1Click:Connect(function()
enabled = not enabled
		Aura.Enabled = enabled
	end)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.