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

It works in Studio, but doesn't work Online? [closed]

Asked by 8 years ago

I don't know what I'm doing wrong. It works flawlessly in Studio, but doesn't do anything (let alone printing a string) while Online.

What I'm trying to accomplish is if the script finds a model with a folder named "Appearance," it'll change the model's parts' brickcolor to the value of the brickcolorvalue (Appearance.SkinColor.Value)

I'm trying to experiment with things, so the following code may look weird to some.

Document = game.ReplicatedStorage:FindFirstChild("Doc")
Camera = workspace.CurrentCamera

while wait(.5) do -- "refresh" every .5 seconds
    for index, value in pairs(Camera:GetChildren()) do
        if value:IsA("Model") then
            local Appearance = value:findFirstChild("Appearance")
            if Appearance then
                print'a'
                for index, skin in pairs(value:GetChildren()) do
                    if skin:IsA("Part") then
                        skin.BrickColor = Appearance.SkinColor.Value
                    end
                end
            elseif not Appearance then
                print'o'
            end
        end
    end
end
0
I forgot to mention that this is in a server script Blues714 0 — 8y
1
CurrentCamera is an object for each player, it works only in local scripts. GullibleChapV2 155 — 8y
0
ahhhh thanks!!! Blues714 0 — 8y

Locked by Shawnyg, Marios2, Necrorave, and User#5978

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?