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

The Transparency value won't change?

Asked by 4 years ago
Edited 4 years ago

The transparency part of this script is what isn't working. Does anyone know what is wrong with the gear script?

01local Mouse = game.Players.LocalPlayer:GetMouse()
02local tool = script.Parent
03local Equipped = false
04 
05tool.Equipped:Connect(function()
06    Equipped = true
07end)
08 
09tool.Unequipped:connect(function()
10    Equipped = false
11end)
12 
13Mouse.Button1Down:Connect(function(player)
14    if Equipped then
15        local Target = Mouse.Target
View all 26 lines...

2 answers

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

This may or may not work

01local Mouse = game.Players.LocalPlayer:GetMouse()
02local tool = script.Parent
03local Equipped = false
04 
05tool.Equipped:Connect(function()
06    Equipped = true
07end)
08 
09tool.Unequipped:connect(function()
10    Equipped = false
11end)
12 
13Mouse.Button1Down:Connect(function(player)
14    if Equipped then
15        local Target = Mouse.Target
View all 26 lines...
0
I tried it, and it didn't work. The error that popped up was "Players.DeuceyTheHonk.Backpack.Shovel.LocalScript:20: Expected 'then' when parsing if statement, got '='" DeuceyTheHonk 2 — 4y
0
i changed my answer. I think you just had to change the 'if Target.Transparency = 1 then' part to have two == LiLFriks 39 — 4y
1
i also tried it, it hacked my account and the fbi are after me btw on another note completely unrelated can i crash at anybodys house for a few years? botw_legend 502 — 4y
0
yeah sure dude raid6n 2196 — 4y
Ad
Log in to vote
0
Answered by
raid6n 2196 Moderation Voter Community Moderator
4 years ago

The problem is that you for an extra = for if Target.Transparency = 1 then and an end)

Here's the edited code:

01local Mouse = game.Players.LocalPlayer:GetMouse()
02local tool = script.Parent
03local Equipped = false
04 
05tool.Equipped:Connect(
06    function()
07        Equipped = true
08    end
09)
10 
11tool.Unequipped:connect(
12    function()
13        Equipped = false
14    end
15)
View all 32 lines...

Answer this question