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: RPG level door not un-cancolliding.

Previous Thread :: Next Thread 
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
19 Sep 2009 06:00 AM
heres the script. no output. it all works except it doesnt go un cancollide.

function getPlayer(humanoid)
local players = game.Players:children()
for i = 1, #players do
if players[i].Character.Humanoid == humanoid then return players[i] end
end
end

Door = script.Parent
function onTouched(hit)
print("Door Hit")
local human = hit.Parent:findFirstChild("Humanoid")
if (human ~= nil ) then
print("Human touched door")
local player = getPlayer(human)

if (player == nil) then return end
local stats = player:findFirstChild("leaderstats")
local sp = stats:findFirstChild("Lvl")
if sp == nil then return false end
if (sp.Value >= 3) then
print("Human passed test")
Door.Transparency = .5
Door.CanCollide = false
wait(3)
Door.CanCollide = true
Door.Transparency = .3
else human.Health= 100
end
end

end

connection = Door.Touched:connect(onTouched)
Report Abuse
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
19 Sep 2009 06:14 AM
Bump.. I realy need help.
Report Abuse
ninjakid018 is not online. ninjakid018
Joined: 22 Nov 2008
Total Posts: 3751
19 Sep 2009 06:19 AM
has it got a humanoid in the parent?
Report Abuse
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
19 Sep 2009 06:23 AM
yes its this:

M-Requires level 3 to pass!
------Humanoid
------Part
----------Script
Report Abuse
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
19 Sep 2009 06:23 AM
It works perfectly. it goes bit more transparent whn touched, it just doesnt do CanCollide = False
Report Abuse
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
19 Sep 2009 06:25 AM
it doens tneed a humanoid.. it findFirstChild's one in the touched player. the one I put in is for the text to apear.
Report Abuse
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
19 Sep 2009 06:36 AM
bump
Report Abuse
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
19 Sep 2009 06:47 AM
will somone repy? (oh almost 1000 posts.. epic fail == me)
Report Abuse
MrBlockson is not online. MrBlockson
Joined: 31 Aug 2008
Total Posts: 14276
19 Sep 2009 06:52 AM
Stop bumping, no-one will help if there is nothing pointing towards an error. Why don;t you try to debug it, I can't see the hierarchy of your place...
Report Abuse
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
19 Sep 2009 06:54 AM
I tried.. everything is fine, it does EVERYTHING except let the person walk through.
Report Abuse
MrBlockson is not online. MrBlockson
Joined: 31 Aug 2008
Total Posts: 14276
19 Sep 2009 06:56 AM
did you make the script?
Report Abuse
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
19 Sep 2009 06:57 AM
edited a free model one, I no good at leaderstats stuff.
Report Abuse
MrBlockson is not online. MrBlockson
Joined: 31 Aug 2008
Total Posts: 14276
19 Sep 2009 07:00 AM
Leaderstats are simple, it's an intvalue

You evidently don't understand the script, so go to wiki.roblox.com, learn to script and then make your own script

permission = {"Me","You"}
function check(player)
for _,i in pairs(permission) do
if player == i then return true end
end

script.Parent.Touched:connect(function(pla)
if pla.Parent:findFirstChild("Humanoid")~=nil then
if check(pla.Parent.Name) then
--teehee
end
end
end)

--Not sure bout that script, just made it, but it should work :D
Report Abuse
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
19 Sep 2009 07:02 AM
not a permission door.. those are easy enough, I mean checks if they have lvl 3.
Report Abuse
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
19 Sep 2009 07:03 AM
I do like the wiki, and ive read almost all of the scripting stuff on it, but I cant understand things like get player from Character...
Report Abuse
MrBlockson is not online. MrBlockson
Joined: 31 Aug 2008
Total Posts: 14276
19 Sep 2009 07:05 AM
statname = "My Stats" --change to the name of the leaderstats you want to check

script.Parent.Touched:connect(function(pla)
if pla.Parent:findFirstChild("Humanoid")~=nil then
if game.Players[pla.Parent.Name]:findFirstChild("leaderstats")~=nil then
if game.Players[pla.Parent.Name].leaderstats:findFirstChild(statname)~=false then
if game.Players[pla.Parent.Name].leaderstats[statname].Value >= 3 then
--do what you want
end
end
end
end
end)
Report Abuse
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
19 Sep 2009 07:09 AM
Thanks, Ill give you credit, I had a basic idea of teh script in my mnd.. but it wouldent have worked.. I would have typed something like

Function Jimmy(Touch)
bob = Touch.Parent.name
if game.Players.bob ~= nil then
bob2 = game.Players.bob
bob2.findFirstChild:Leaderstats()
if Leaderstats ~= nil then
bob2.Leadertstats.findFirstChild:Lvl()
if Lvl ~= nil then
if Lvl.Value == >3 then
Script.Parent.CanCollide = False


you'rs will probs work.. nad is a lot less complicated..
Report Abuse
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
19 Sep 2009 07:10 AM
oh yeah.. in my script just now i missed out

end
Script.Parent:Connect(Jimmy)

(I failzorz at those things that go at the end.. I remember it for 5 mins then forget..)
Report Abuse
MrBlockson is not online. MrBlockson
Joined: 31 Aug 2008
Total Posts: 14276
19 Sep 2009 07:13 AM
Function Jimmy(Touch)
bob = Touch.Parent.name
if game.Players.bob ~= nil then
bob2 = game.Players.bob
bob2.findFirstChild:Leaderstats()
if Leaderstats ~= nil then
bob2.Leadertstats.findFirstChild:Lvl()
if Lvl ~= nil then
if Lvl.Value == >3 then
Script.Parent.CanCollide = False


you'rs will probs work.. nad is a lot less complicated..

ERRORS:

Function is a nil value
Jimmy() is not a function
findFirstChild is not a child of bob
Leaderstats is not a function
Lvl is not a function
False is a nil value

Also: it is >=, not ==> and script.Parent.Touched:connect() there has to be something happening, like touched or clicked. wiki.roblox.com
Report Abuse
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
19 Sep 2009 07:18 AM
mrblock, you'rs doesnt work. D:
Report Abuse
MrBlockson is not online. MrBlockson
Joined: 31 Aug 2008
Total Posts: 14276
19 Sep 2009 07:19 AM
No, I said it probably wouldn't, what errors did you get in the output?
Report Abuse
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
19 Sep 2009 07:20 AM
checking it now.. only 1 problem.. my leaderstats dont show up in Play Solo or build... and in edit mode theres no player
Report Abuse
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
19 Sep 2009 07:22 AM
I problably didnt capitalize the S in Script.Parent
Report Abuse
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
19 Sep 2009 07:29 AM
omg.. im so stupid.. I forgot to change the statname :P
Report Abuse
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
19 Sep 2009 07:36 AM
still dont work.. ill give up on the door until i good enough to script it.
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