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: Turning a player into a

Previous Thread :: Next Thread 
DevObject is not online. DevObject
Joined: 28 Jul 2011
Total Posts: 7048
17 Jul 2016 08:07 PM
custom mesh when touched by another player (humanoid)
but it turns them into a red block instead
local active = false
function onTouched(hit)
if active == false then
active = true
local hum = hit.Parent:findFirstChild("Humanoid")
if hum ~= nil then
local player = game.Players:findFirstChild(hum.Parent.Name)
local self = game.Players:findFirstChild(script.Parent.Parent.Name)
if player ~= nil and self ~= nil then
local lead = player:findFirstChild("leaderstats")
local it = player:findFirstChild("ItStatus")
local leaderstats = self:findFirstChild("leaderstats")
if lead ~= nil and it ~= nil and leaderstats ~= nil then
local tag = leaderstats:findFirstChild("Tags")
if tag ~= nil then
if script.Name == "TagIt" and it.Value == false then
if lead.Value == 0 then
lead.Value = 2
tag.Value = tag.Value + 1
local parts = hit.Parent:GetChildren()
for i = 1,#parts do
if parts[i].className == "Part" then
parts[i].Anchored = true
if parts[i].Name == "Torso" then
local block = Instance.new("Part")
block.Anchored = true
block.CanCollide = false
block.Size = Vector3.new(5,7.2,5)
block.Transparency = 0
block.Transparency = 0
block.BrickColor = BrickColor.new("Really red")
block.Name = "TagBlock"
block.CFrame = parts[i].CFrame * CFrame.fromEulerAnglesXYZ(math.rad(math.random(-10,10)),math.rad(math.random(-180,180)),math.rad(math.random(-10,10)))
block.Parent = hit.Parent
g = Instance.new("MeshPart")
g.MeshType = "CustomMesh"
g.MeshId = ("http://www.roblox.com/asset/?id=1527559")
g.TextureId = ("http://www.roblox.com/asset/?id=430070478")
g.Scale = Vector3.new(5,5,5)
g.Parent = block
end
end
end
local humanoid = player.Character:findFirstChild("Humanoid")
if humanoid ~= nil then
humanoid.WalkSpeed = 0
end
active = false
wait(5)
lead.Value = 1
end
end
if script.Name == "TagFlee" and it.Value == false then
if lead.Value == 1 then
lead.Value = 0
tag.Value = tag.Value + 1
local humanoid = player.Character:findFirstChild("Humanoid")
if humanoid ~= nil then
humanoid.WalkSpeed = 16
end
local parts = hit.Parent:GetChildren()
for i = 1,#parts do
if parts[i].className == "Part" then
parts[i].Anchored = false
end
end
local new_script = script:clone()
new_script.Parent = script.Parent
script:remove()
end
end
end
end
end
end
active = false
end
end
local part = script.Parent.Parent:GetChildren()
for i = 1,#part do
if string.find(part[i].Name, "Arm") ~= nil or string.find(part[i].Name, "Head") ~= nil then
part[i].Touched:connect(onTouched)
end
end



#code R$1
Report Abuse
HeIIoISteaIUsernames is not online. HeIIoISteaIUsernames
Joined: 26 Oct 2012
Total Posts: 2906
17 Jul 2016 08:08 PM
didnt you copy this from a free-model freeze tag script
Report Abuse
DevObject is not online. DevObject
Joined: 28 Jul 2011
Total Posts: 7048
17 Jul 2016 08:10 PM
Yes^^^


#code R$1
Report Abuse
DogeKip is not online. DogeKip
Joined: 06 Mar 2011
Total Posts: 6860
17 Jul 2016 08:10 PM
"didnt you copy this from a free-model freeze tag script"
and now I'm not offering help...


[Redacted]
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
17 Jul 2016 08:11 PM
its because the mesh id is wrong
Report Abuse
DevObject is not online. DevObject
Joined: 28 Jul 2011
Total Posts: 7048
17 Jul 2016 08:12 PM
How is it wrong?


#code R$1
Report Abuse
HeIIoISteaIUsernames is not online. HeIIoISteaIUsernames
Joined: 26 Oct 2012
Total Posts: 2906
17 Jul 2016 08:12 PM
@doge

were you talking about me??
Report Abuse
DogeKip is not online. DogeKip
Joined: 06 Mar 2011
Total Posts: 6860
17 Jul 2016 08:13 PM
"were you talking about me??"
You pointed out that it was a free model and that made me not want to give any assistance


[Redacted]
Report Abuse
lululukas is not online. lululukas
Joined: 23 Aug 2010
Total Posts: 1043
17 Jul 2016 08:13 PM
You usually have to subtract 1 from the id i believe. Or is that only for decals?


Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
17 Jul 2016 08:15 PM
"Instance.new("MeshPart")"
noob where the hell did you get this
i think it's "SpecialMesh"
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
17 Jul 2016 08:19 PM
MeshPart is a new thing, it shipped a few weeks before user-made meshes did. It allows meshes to have accurate collisions now.


Report Abuse
DevObject is not online. DevObject
Joined: 28 Jul 2011
Total Posts: 7048
17 Jul 2016 08:20 PM
I'm trying to make the player (that has been touched by the other player) a custom mesh


#code R$1
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
17 Jul 2016 08:36 PM
I don't think meshparts are supposed to be parented like a mesh
Report Abuse
DevObject is not online. DevObject
Joined: 28 Jul 2011
Total Posts: 7048
17 Jul 2016 08:37 PM
So basically I can't do what I'm trying to do...?


#code R$1
Report Abuse
iondriver is not online. iondriver
Joined: 18 Nov 2012
Total Posts: 757
17 Jul 2016 09:47 PM
I think I found one of the issues.

you have g.MeshType = "CustomMesh"

MeshParts do not have this field. I bet you that your script is breaking here.


A mesh part is just like a normal part, except it can take a mesh. So g.Scale will also cause the script to error.

Look at this wiki article for help.

http://wiki.roblox.com/index.php?title=API:Class/MeshPart
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