Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Script not working aplease help me fix!.?

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

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)

2 comments

0

Oh can u explane the valuechange thing?

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)".

This discussion is preserved as it was. New answers, comments, and votes are closed.