Although I Pressed space when the character's head is transparent it did not run in game and when I press space in roblox studio solo mode, it works perfectly without changing the script.
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
Mouse.KeyDown:connect(function(key)
if key:byte() == 32 then
if Player.Character.Head.Transparency == 1 then
Player.Character.Parent = game.Workspace
end
end
end)

8 comments
Why are you parenting the character to workspace? It's already in there...
I moved the parent to a model in workspace so It would move the location that model moves
So you will parent the character to another model in workspace? And you want to check if they're jumping and they have their head transparent?
I replaced line 7 with a print function and it worked so it should
Answer my question.
LocalScripts only run in places that are individual to each player, such as their gui or backpack (not in workspace). If you move the script into StarterGui or some other 'local' place, it should run.
This makes no sense. The character model is automatically in Workspace.
The character is the only location local scripts can run in in workspace, because each player has their own individual character. Having it in a random part, however, would not tell you who the local script belongs to, and therefore not run it.