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 » Scripting Helpers
Home Search
 

Re: Character Help

Previous Thread :: Next Thread 
blockhawkdown is not online. blockhawkdown
Joined: 29 Mar 2014
Total Posts: 38
04 Apr 2014 10:37 PM
I've made a script that is supposed to give a BlockMesh to every part of a player's body. The script does not work. Please help.

Script:

local player = script.Parent.Parent
local char = player.Character

game.Players.PlayerAdded:connect(function()
for i, v in pairs do
bm = Instance.new('BlockMesh')
bm.Parent = child
end
end)
Report Abuse
yurhomi10 is not online. yurhomi10
Joined: 10 Dec 2008
Total Posts: 13886
04 Apr 2014 10:40 PM
is this a local script?

if so

player = script.Parent.LocalPlayer -- I believe.
character = player.Character
Report Abuse
blockhawkdown is not online. blockhawkdown
Joined: 29 Mar 2014
Total Posts: 38
04 Apr 2014 10:43 PM
Hm. It's currently in StarterPack. Let me make a few changes.
Report Abuse
blockhawkdown is not online. blockhawkdown
Joined: 29 Mar 2014
Total Posts: 38
04 Apr 2014 10:44 PM
I've put it in Lighting (as a LocalScript).

Script:

local player = script.Parent.LocalPlayer
local char = player.Character

game.Players.PlayerAdded:connect(function()
for i, v in pairs do
bm = Instance.new('BlockMesh')
bm.Parent = child
end
end)
Report Abuse
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
04 Apr 2014 10:45 PM
player = game.Players.LocalPlayer
in a localscript
its k bros
Report Abuse
yurhomi10 is not online. yurhomi10
Joined: 10 Dec 2008
Total Posts: 13886
04 Apr 2014 10:45 PM
woe.

game.Players.PlayerAdded:connect(function(player)
for i, v in pairs(player.Character) do
if v:IsA("Part") then
local block = Instance.new("BlockMesh")
block.Parent = v
end
end
end)

that should work if not, I didnt test so check it out.
Report Abuse
blockhawkdown is not online. blockhawkdown
Joined: 29 Mar 2014
Total Posts: 38
04 Apr 2014 10:46 PM
It didn't work.
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
04 Apr 2014 10:47 PM
normal script in serverscriptservice block.
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
04 Apr 2014 10:48 PM
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(char)
for i, v in pairs(char:GetChildren()) do
if v:IsA("BasePart") then
local block = Instance.new("BlockMesh")
block.Parent = v
end
end
end)
end)
Report Abuse
yurhomi10 is not online. yurhomi10
Joined: 10 Dec 2008
Total Posts: 13886
04 Apr 2014 10:49 PM
sorry, IT should work now

MAKE SURE ITS A SCRIPT IN WORKSPACE, Local scripts would be a little bit more complicated to insert to player and such.

--

game.Players.PlayerAdded:connect(function(player)
player:WaitForChild("Backpack")
parts = player.Character:GetChildren()
for i, v in pairs(parts) do
if v:IsA("Part") then
local block = Instance.new("BlockMesh")
block.Parent = v
end
end
end)
Report Abuse
blockhawkdown is not online. blockhawkdown
Joined: 29 Mar 2014
Total Posts: 38
04 Apr 2014 10:52 PM
Duelingwarlord got it right. Thanks to all who helped.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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