pls help me again i added a click to transparency change my part but it not working whats weird about it its theres no error output it just wont work idk why this is frustrating pls heelp
01 | part = game.Workspace.skate |
02 | transparency = part.Transparency |
03 | clickdetector = part.ClickDetector |
04 |
05 | clickdetector.MouseClick:Connect( function () |
06 | print ( "change transparency" ) |
07 | if transparency > = 1 then transparency = 0 end |
08 | transparency = transparency + . 1 |
09 | end ) |
10 |
11 | while true do |
12 | part.CFrame = part.CFrame*CFrame.new( 1 , 0 , 0 ) |
13 | part.BrickColor = BrickColor.random() |
14 | print ( "debug" ) |
15 | end |
Let's see what I can debug here in your script.
Here is the modified script:
01 | part = game.Workspace.skate |
02 | local clickdetector = part.ClickDetector |
03 |
04 | clickdetector.MouseClick:Connect( function () |
05 | print ( "change transparency" ) |
06 | if part.Transparency > = 1 then |
07 | part.Transparency = 0 |
08 | end |
09 | part.Transparency = part.Transparency + 0.1 |
10 | end ) |
11 |
12 | while true do |
13 | part.CFrame = part.CFrame*CFrame.new(Vector 3. new( 1 , 0 , 0 )) |
14 | part.BrickColor = BrickColor.Random() |
15 | print ( "debug" ) |
16 | wait() |
17 | end |
01 | part = game.Workspace.skate |
02 | transparency = part.Transparency |
03 | clickdetector = part.ClickDetector |
04 |
05 | clickdetector.MouseClick:Connect( function () |
06 | print ( "change transparency" ) |
07 | if transparency > 0.9 then |
08 | transparency = 0 |
09 | end |
10 |
11 | transparency = transparency + 0.1 -- If your trying to make the part fade, add this inside the loop (while true do) |
12 | end ) |
13 |
14 | spawn( function () -- This is to make sure the loop doesn't interrupt the MouseClick function |
15 | while true do |
01 | part = game.Workspace.skate |
02 | clickdetector = part.ClickDetector |
03 |
04 | clickdetector.MouseClick:Connect( function () |
05 | print ( "change transparency" ) |
06 | if part.Transparency > = 1 then part.Transparency = 0 end |
07 | part.Transparency = part.Transparency + . 1 |
08 | end ) |
09 |
10 | while true do |
11 | part.CFrame = part.CFrame*CFrame.new( 1 , 0 , 0 ) |
12 | part.BrickColor = BrickColor.random() |
13 | print ( "debug" ) |
14 | wait() |
15 | end |