|
| 12 Sep 2015 12:41 AM |
okay so i have a face toggler gui that changes from a set face and your own face but its not toggling back to your normal face. here is the script: local vamp=false script.Parent.MouseButton1Click:connect(function() local name= script.Parent.Parent.Parent.Parent.Name local me=game.Workspace:FindFirstChild(name) local text=me.Head.face.Texture
if vamp==false then me.Head.face.Texture="rbxassetid://148892430" else me.Head.face.Texture=text end print'changed!' print'reset' if vamp==true then vamp=false else vamp=true end end) Thanks for the help
~Cool |
|
|
| Report Abuse |
|
|
|
| 12 Sep 2015 12:45 AM |
vamp is what i decided to call the varible that holds the toggle
~Cool |
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Sep 2015 05:45 PM |
kay no one is responding
~Cool |
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Sep 2015 05:59 PM |
lemme check it real quick but from what i remember, no
~Cool |
|
|
| Report Abuse |
|
|
| |
|
R0Y8
|
  |
| Joined: 13 Jul 2014 |
| Total Posts: 160 |
|
|
| 13 Sep 2015 06:07 PM |
I think the mistake may have been that you didn't do vamp.Value
local vamp.Value=false script.Parent.MouseButton1Click:connect(function() local name= script.Parent.Parent.Parent.Parent.Name local me=game.Workspace:FindFirstChild(name) local text=me.Head.face.Texture
if vamp.Value==false then me.Head.face.Texture="rbxassetid://148892430" else me.Head.face.Texture=text end print'changed!' print'reset' if vamp.Value==true then vamp.Value=false else vamp.Value=true end end) |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2015 06:08 PM |
Well its a bool variable but i could update it to that and try it that way
~Cool |
|
|
| Report Abuse |
|
|
R0Y8
|
  |
| Joined: 13 Jul 2014 |
| Total Posts: 160 |
|
| |
|
|
| 13 Sep 2015 06:10 PM |
It could be the fact that the if isn't working correctly because it works when i turn it on, but not off
~Cool |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2015 06:12 PM |
| Or Perhaps its the saved face texture not working, lemme try to set up a value for tht also and test |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2015 06:14 PM |
I'll make a video and show whats wrong
~Cool |
|
|
| Report Abuse |
|
|
R0Y8
|
  |
| Joined: 13 Jul 2014 |
| Total Posts: 160 |
|
|
| 13 Sep 2015 06:18 PM |
Try doing
local vamp = Instance.new("BoolValue", script.Parent) vamp.Value = false |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2015 06:19 PM |
i have the value in the gui, inserted before the game starts
~Cool |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2015 06:20 PM |
i also made a youtube video to show the demo its a bit long tho link: https://www.youtube.com/watch?v=cqNDdSpyZKg&feature=youtu.be
~Cool |
|
|
| Report Abuse |
|
|
R0Y8
|
  |
| Joined: 13 Jul 2014 |
| Total Posts: 160 |
|
|
| 13 Sep 2015 06:26 PM |
local text.Value = me.Head.face.Texture
maybe that was the problem? |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2015 06:27 PM |
i'm not exactly sure what the error is because it could be: The If Statements The Text variable. that is all
~cool (i screwed up my auto sig) |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2015 06:28 PM |
@R0Y What on earth are you talking about.
|
|
|
| Report Abuse |
|
|
| |
|
R0Y8
|
  |
| Joined: 13 Jul 2014 |
| Total Posts: 160 |
|
|
| 13 Sep 2015 06:30 PM |
| lol sorry CloneTrooper1019 |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2015 06:31 PM |
Okay, here's a fix. In order for this to work, it needs to be a LocalScript
local vamp = false local player = game.Players.LocalPlayer local oldFace = nil
local function onClicked() local char = player.Character if char then local head = char:WaitForChild("Head") local face = head:WaitForChild("face") vamp = not vamp if vamp then oldFace = face.Texture face.Texture = "rbxassetid://148892430" else face.Texture = oldFace end end end
script.Parent.MouseButton1Click:connect(onClicked) |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2015 06:34 PM |
Also, for future reference, don't use normal scripts inside of GUIs. Like, at all.
|
|
|
| Report Abuse |
|
|
|
| 13 Sep 2015 06:35 PM |
Okay, Thanks everyone for all the help! i am really glad that you helped!
~Cool |
|
|
| Report Abuse |
|
|