generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Welds.

Previous Thread :: Next Thread 
Aj7Fish is not online. Aj7Fish
Joined: 30 Dec 2014
Total Posts: 500
08 Feb 2015 04:51 PM
-- I tried making a script that when a player spawns, they spawn with a small ball above their head. I tried this but it didn't work. Why?

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
local Danger = Instance.new("Part")
Danger.Parent = game.Workspace
Danger.Shape = "Ball"
Danger.Size = Vector3.new(1,1,1)
Danger.Transparency = 0.5
Danger.Reflectance = 0.5
Danger.BrickColor = BrickColor.new("Lime green")
Danger.Name = "Danger"
Danger.Material = "SmoothPlastic"

local weld = Instance.new("Weld")
Danger.CFrame = character.Head.CFrame * CFrame.new(0,5,0)
weld.Parent = Danger
weld.Part0 = character.Head
weld.C0 = character.Head.CFrame:inverse()
weld.Part1 = Danger
weld.C1 = Danger.CFrame:inverse()

end)
end)
Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
08 Feb 2015 04:54 PM
game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        local Danger = Instance.new("Part")
        Danger.Parent = game.Workspace
        Danger.Shape = "Ball"
        Danger.Size = Vector3.new(1,1,1)
        Danger.Transparency = 0.5
        Danger.Reflectance = 0.5
        Danger.BrickColor = BrickColor.new("Lime green")
        Danger.Name = "Danger"
        Danger.Material = "SmoothPlastic"

        local weld = Instance.new("Weld")
        weld.Parent = Danger
        weld.Part0 = character.Head
        weld.Part1 = Danger
        weld.C0 = character.Head.CFrame:inverse()*character.Head.CFrame * CFrame.new(0,5,0)

    end)
end)
Report Abuse
Aj7Fish is not online. Aj7Fish
Joined: 30 Dec 2014
Total Posts: 500
08 Feb 2015 04:59 PM
That didn't work.
Report Abuse
Aj7Fish is not online. Aj7Fish
Joined: 30 Dec 2014
Total Posts: 500
08 Feb 2015 05:06 PM
I know welds are confusing, but if anyone knows please reply.
Report Abuse
DrMathematica is not online. DrMathematica
Joined: 29 Aug 2008
Total Posts: 27268
08 Feb 2015 05:08 PM
Wait a frame before creating the weld. It works then.
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
character:WaitForChild("Head");
character:WaitForChild("Humanoid");

local Danger = Instance.new("Part")
Danger.Shape = "Ball"
Danger.Size = Vector3.new(1,1,1)
Danger.Transparency = 0.5
Danger.Reflectance = 0.5
Danger.BrickColor = BrickColor.new("Lime green")
Danger.Name = "Danger"
Danger.Material = "SmoothPlastic"
Danger.Parent = game.Workspace
wait()
local weld = Instance.new("Weld")
weld.Parent = Game.JointsService
weld.Part0 = character.Head
weld.Part1 = Danger
weld.C1 = CFrame.new(0,-1,0);

end)
end)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image