|
| 07 Sep 2014 12:40 AM |
I have an old book on learning to script. I can't find my error, but maybe you guys can? The door doesn't let me in OR kill me. It's like it's just a brick.
local Door = script.Parent --Declare the part as Door
function onTouch(Brick) --Sets the start of our function and when triggered it gives brick, the object that was hit
local Player = Brick.Parent:findFirstChild("Humanoid") --Finds Humanoid in Brick
if (Player ~= nil) then --Checks if Player is a real Player
if Player.Parent.Torso.roblox.Texture == "http://www.roblox.com/asset/? version=1&id=10339101" then
Door.CanCollide = false
Door.Transparency = 0.5
Door.BrickColor = BrickColor:Random()
wait(2)
Door.CanCollide = true
Door.Transparency = 0
Door.BrickColor = BrickColor:Random()
else Player.Health = 0
Door.Touched:connect(onTouch)
end end end
Sorry I can't say which line, it doesn't say that there is any error.
~Amongst the Shadows~ |
|
|
| Report Abuse |
|
|
LemmJuice
|
  |
| Joined: 23 Feb 2014 |
| Total Posts: 866 |
|
|
| 07 Sep 2014 12:47 AM |
| You are using a decal instead of the shirt object. |
|
|
| Report Abuse |
|
|
|
| 07 Sep 2014 12:50 AM |
-- I hated that script, so I wrote you a new one. -- With this, they don't need to wear the t-shirt.
local serv = game:FindService("MarketplaceService"); local id = 10339102;
script.Parent.Touched:connect(function(data) if data.Parent:FindFirstChild("Humanoid") == true then local plr = game.Players:GetPlayerFromCharacter(data.Parent); if(serv:PlayerOwnsAsset(plr, id)) then script.Parent.CanCollide = false; script.Parent.Transparency = 0.5; script.Parent.BrickColor = BrickColor.Random(); wait(2); script.Parent.CanCollide = true; script.Parent.Transparency = 0; script.Parent.BrickColor = BrickColor.Random(); else data.Parent:BreakJoints(); end end end) |
|
|
| Report Abuse |
|
|
|
| 07 Sep 2014 12:52 AM |
There's no way to fix it? I'm trying to learn, not make a game.
~Amongst the Shadows~ |
|
|
| Report Abuse |
|
|
LemmJuice
|
  |
| Joined: 23 Feb 2014 |
| Total Posts: 866 |
|
|
| 07 Sep 2014 01:02 AM |
| That script that guy just posted, is the recommened way now. Just look through and see how it works, that's how I started learning. |
|
|
| Report Abuse |
|
|
|
| 07 Sep 2014 01:07 AM |
print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills" print "you haz no skrapting skills"
|
|
|
| Report Abuse |
|
|