How do I fix my code so that it makes the block transparent

local partToChange = script.Parent

local function onPlayerChatted(player, message)
if message == “jump” then
partToChange.Transparency = 0.5
partToChange.CanCollide = false
wait(3)
partToChange.Transparency = 0
partToChange.CanCollide = true
end
end

game.Players.PlayerChatted:Connect(onPlayerChatted)

The code is attached to a part, and I am trying to make it so that the part turns half transparent and allows my character to go through when I say “jump” but it doesn’t work

change the 0 to 1

partToChange.Transparency = 0 
local partToChange = script.Parent

game.Players.PlayerChatted:Connect(function(chatType, player, message, targetPlayer)
    if message == "jump" then
        partToChange.Transparency = 0.5
        partToChange.CanCollide = false
        task.wait(3)
        partToChange.Transparency = 1
        partToChange.CanCollide = true
    end
end)

Well it would need to be in a serverscript preferably in server script service then just change the partToChange to game.Workspace[part.name] so like this:

local partToChange = game.Workspace[partNameHere]

game.Players.PlayerChatted:Connect(function(chatType, player, message, targetPlayer)
    if message == "jump" then
        partToChange.Transparency = 0.5
        partToChange.CanCollide = false
        task.wait(3)
        partToChange.Transparency = 1
        partToChange.CanCollide = true
    end
end)