What do you want to achieve? Trying to do an music that everyone can hear once someone gets the target value.
What is the issue? This error is showing up:
--Character is not a valid member of 'Players' "Players"
What solutions have you tried so far? I tried to many things of my last topic but still din’t work.
My script:
local Player = game:GetService("Players")
local power = script.Parent
local character = script.Parent.Parent
script.Parent.Changed:Connect(function()
if script.Parent.Value == 43 then
local kills5 = Instance.new("Sound",Player.Character.Humanoid.Torso)
kills5.SoundId = "rbxassetid://10636340314"
kills5.Looped = true
kills5.Volume = 2.2
kills5:Play()
Player.Character.Humanoid.WalkSpeed = 23
end
if script.Parent.Value == 45 then
Player.Character.Humanoid.WalkSpeed = 25
end
if script.Parent.Value == 47 then
Player.Character.Humanoid.WalkSpeed = 27
end
end)
local Player = game:GetService("Players")
local power = script.Parent
local character = script.Parent.Parent
script.Parent.Changed:Connect(function()
if script.Parent.Value == 43 then
for I,v in pairs(Player:GetChildren()) do
local kills5 = Instance.new("Sound")
kills5.Parent = v:WaitForChild("Torso")
kills5.SoundId = "rbxassetid://10636340314"
kills5.Looped = true
kills5.Volume = 2.2
kills5:Play()
v:WaitForChild("Humanoid").WalkSpeed = 23
end
if script.Parent.Value == 45 then
v.Humanoid.WalkSpeed = 25
end
if script.Parent.Value == 47 then
v.Humanoid.WalkSpeed = 27
end
end
end)