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

PointLight won't change color, when I debugged nothing works. Nothing comes in the output either?

Asked by 2 years ago

Hi, I'm trying to make my pointlight work so that whenever someone says a colour, it changes. It works with the parts, but not the pointlight.

local admins = {
    ["Tyxgo"] = "Admin";
    ["Cuty2828"] = "Admin";
    ["ilikepizzatheking"] = "Admin";
}

local collectionService = game:GetService("CollectionService")
local getTagged = collectionService:GetTagged("BlueBrick")
local tweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(0.8,Enum.EasingStyle.Sine,Enum.EasingDirection.In,0,false,0)

game.Players.PlayerAdded:Connect(function(plr)
    plr.Chatted:Connect(function(msg)
        if admins[plr.Name] then
            if string.lower(msg) == "black" then
                for i, v in pairs(getTagged) do
                    if v:IsA("Part") then
                        tweenService:Create(v,tweenInfo,{Color = Color3.new(0, 0, 0)}):Play()
                    end
                end
            elseif string.lower(msg) == "blue" then
                for i, v in pairs(getTagged) do
                    if v:IsA("Part") or v:IsA("PointLight") then
                        tweenService:Create(v,tweenInfo,{Color = Color3.new(0.113725, 0, 1)}):Play()
                    end
                    if v:IsA("PointLight") then
                        v.Color = Color3.fromRGB(255,0,0)
                    end
                end
            end
        end
    end)
end)
0
why are you tweening pointlight when it does so without a tween anyway? RAFA1608 543 — 2y
0
you should use a generalized function for all colors instead of inconsistency RAFA1608 543 — 2y
0
i'm not tweening a point light - i'm tweening parts, i just forgot to remove "or v:IsA("PointLight")". do u have a possible solution for this? ISkyLordDoge 37 — 2y

Answer this question