Duckywow
|
  |
| Joined: 24 Oct 2013 |
| Total Posts: 6110 |
|
|
| 26 Apr 2015 09:58 AM |
I tried it, i cant seem to get it to work and i am very confused...
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 -- a human has touched this door! print("Human touched door") -- test the human's name against the leaderboard local player = getPlayer(human) if (player == nil) then return end local stats = player:findFirstChild("leaderstats") local sp = stats:findFirstChild("Points") if sp == nil then return false end if (sp.Value <= 1) then Door.CanCollide = true else Door.Cancollide = false end end
end
connection = Door.Touched:connect(onTouched)
( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 Insert stupid siggy here ( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 |
|
|
| Report Abuse |
|
|
Proxemics
|
  |
| Joined: 30 Oct 2013 |
| Total Posts: 2542 |
|
|
| 26 Apr 2015 10:03 AM |
local player = game.Players.LocalPlayer local door = game.Workspace.Door --name of the door door.CanCollide = true if player:FindFirstChild("leaderstats") then if player.leaderstats:FindFirstChild("Points") then if player.leaderstats.Points.Value <= 0 then if door.CanCollide = true then door.CanCollide = false else return false end end end |
|
|
| Report Abuse |
|
|
Duckywow
|
  |
| Joined: 24 Oct 2013 |
| Total Posts: 6110 |
|
|
| 26 Apr 2015 10:20 AM |
that didn't work
( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 Insert stupid siggy here ( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 |
|
|
| Report Abuse |
|
|
Duckywow
|
  |
| Joined: 24 Oct 2013 |
| Total Posts: 6110 |
|
|
| 26 Apr 2015 10:25 AM |
bump
( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 Insert stupid siggy here ( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 |
|
|
| Report Abuse |
|
|
Duckywow
|
  |
| Joined: 24 Oct 2013 |
| Total Posts: 6110 |
|
|
| 26 Apr 2015 10:26 AM |
bump
( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 Insert stupid siggy here ( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 |
|
|
| Report Abuse |
|
|
Duckywow
|
  |
| Joined: 24 Oct 2013 |
| Total Posts: 6110 |
|
|
| 26 Apr 2015 10:26 AM |
bump
( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 Insert stupid siggy here ( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 |
|
|
| Report Abuse |
|
|
Duckywow
|
  |
| Joined: 24 Oct 2013 |
| Total Posts: 6110 |
|
|
| 26 Apr 2015 10:27 AM |
bump
( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 Insert stupid siggy here ( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 |
|
|
| Report Abuse |
|
|
|
| 26 Apr 2015 10:27 AM |
use getplrfromchar
God grant me the wisdom to not punch stupid ppl, for I know I will go to prison. |
|
|
| Report Abuse |
|
|
Duckywow
|
  |
| Joined: 24 Oct 2013 |
| Total Posts: 6110 |
|
|
| 26 Apr 2015 10:28 AM |
bump
( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 Insert stupid siggy here ( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 |
|
|
| Report Abuse |
|
|
Duckywow
|
  |
| Joined: 24 Oct 2013 |
| Total Posts: 6110 |
|
|
| 26 Apr 2015 10:32 AM |
bump
( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 Insert stupid siggy here ( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 |
|
|
| Report Abuse |
|
|
|
| 26 Apr 2015 10:33 AM |
stop bumping i told you how
God grant me the wisdom to not punch stupid ppl, for I know I will go to prison. |
|
|
| Report Abuse |
|
|
Duckywow
|
  |
| Joined: 24 Oct 2013 |
| Total Posts: 6110 |
|
|
| 26 Apr 2015 10:38 AM |
please give me a whole script, i dont know about what you told me and how i can make it work...
( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 Insert stupid siggy here ( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 |
|
|
| Report Abuse |
|
|
|
| 26 Apr 2015 10:40 AM |
script.Parent.Touched:connect(function(hit) local p = game.Players:GetPlayerFromCharacter(hit.Parent) if p.leaderstats.Points.Value == 0 then -- do stuff end end)
God grant me the wisdom to not punch stupid ppl, for I know I will go to prison. |
|
|
| Report Abuse |
|
|
Duckywow
|
  |
| Joined: 24 Oct 2013 |
| Total Posts: 6110 |
|
|
| 26 Apr 2015 11:23 AM |
@thenewchicken take a look... it isnt working btw http://www.roblox.com/help-item?id=242506178
i put in this: script.Parent.Touched:connect(function(hit) local p = game.Players:GetPlayerFromCharacter(hit.Parent) if p.leaderstats.Points.Value == 0 then print("Human passed test") Door.Transparency = 1 Door.CanCollide = false wait(3) Door.CanCollide = true else h.Text("You already completed the level!") wait(5) h.Text=false
end
end There are no errors and it is not working!!!
( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 Insert stupid siggy here ( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 |
|
|
| Report Abuse |
|
|
|
| 26 Apr 2015 11:29 AM |
script.Parent.Touched:connect(function(hit) local Door = script.Parent local p = game.Players:GetPlayerFromCharacter(hit.Parent) if p.leaderstats.Points.Value == 0 then print("Human passed test") Door.Transparency = 0.5 Door.CanCollide = false wait(3) Door.CanCollide = true Door.Transparency = 0 else Instance.new('Hint',p.PlayerGui).Text = 'YourTextHere' wait(3) p.PlayerGui.Hint:Destroy() end end)
God grant me the wisdom to not punch stupid ppl, for I know I will go to prison. |
|
|
| Report Abuse |
|
|
Duckywow
|
  |
| Joined: 24 Oct 2013 |
| Total Posts: 6110 |
|
|
| 26 Apr 2015 11:51 AM |
@thenewchicken thanks, it worked
( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 Insert stupid siggy here ( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 |
|
|
| Report Abuse |
|
|