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

Script not working aplease help me fix!.?

Asked by 8 years ago
function Zap(Effect)
     local Player = game.Players.LocalPlayer
     local Char = game.Players.LocalPlayer.Character
     local Skills = Player.Skills
     local Eye = game.Workspace.Eye.Decal 
    ---------StateMents------------
    while true do
    wait(.5)
    if Skills.Flame.Value == true then
        Char.Head.face.Texture = "http://www.roblox.com/asset/?id=139528961"
    end
    end

end
game.Players.ChildAdded:connect(Zap)

The script is in a localscript The out put says notthing

The goal of this script is when ever the BoolValue "Flame" is set true it changes the localplayers face.

1 answer

Log in to vote
0
Answered by 8 years ago

This will do want you want. I did assume some changes though.

This code chunk will not work in a local script. Place this code in a normal script (server script) and it should do what you want

Please tell me if your only able to work in a local script

game.Players.PlayerAdded:connect(function(Player)
    Player.CharacterAdded:connect(function()
        local Char = Player.Character
        local Skills = Player:WaitForChild("Skills")
        local Eye = game.Workspace.Eye.Decal 
        ---------StateMents------------
        local function ValueChange()
            if Skills.Flame.Value == true then
                Char.Head.face.Texture = "http://www.roblox.com/asset/?id=139528961"
            end
        end
        Skills.Flame.Changed:connect(ValueChange)
    end)
end)
0
Oh can u explane the valuechange thing? KFCPhoeyu 41 — 8y
0
"ValueChange" is simply the name of a local function and is called when ever the value of "Flame" changes thus "Skills.Flame.Changed:connect(ValueChange)". ClassicTheBlue 65 — 8y
Ad

Answer this question