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: LuaLearners script help

Previous Thread :: Next Thread 
multrimax is not online. multrimax
Joined: 25 Dec 2009
Total Posts: 10294
11 May 2013 08:53 PM
Allowed = {"multrimax", "coolbob44"}

function isAllowed(hit)
hum = hit.Parent:FindFirstChild("Humanoid")
if hum ~= nil then
for i = 1, #Allowed do
if Allowed[i].Name == "multrimax" then
if Allowed[i].Name == "Coolbob44" then
g = game.Workspace:GetChildren()
for i = 1, #g do
if g[i].ClassName == "Part" then
g[i].CFrame = CFrame.fromEulerAnglesXYZ(0.9, 0.9, 0.9)
local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = plyrname.." broke this place!"
wait(4)
m:Destroy()
end
end
end
else
if Allowed[i].Name ~= "multrimax" then
if Allowed[i].Name ~= "Coolbob44" then
f = hit.Parent:FindFirstChild("Humanoid")
f.Health = 0
local a = game.Players:GetPlayerFromCharacter(hit.Parent)
local b = Instance.new("Message")
b.Parent = a.PlayerGui
b.Text = "Go away!"
wait(4)
end
end
end
end
end
end

script.Parent.Touched:connect(isAllowed)

Even though I'm on the table, it just displays the "Go away!" text. Any help?
Report Abuse
WTSHelper1 is not online. WTSHelper1
Joined: 28 Feb 2011
Total Posts: 1721
11 May 2013 09:02 PM
"if Allowed[i].Name ~= "multrimax" then
if Allowed[i].Name ~= "Coolbob44" then "

That makes YOU have the GUI, because it says 'if' and 'then', causing it to only happen for you two. Make it so it's NOT you or coolbob44, and then the script will work.
Report Abuse
multrimax is not online. multrimax
Joined: 25 Dec 2009
Total Posts: 10294
11 May 2013 09:28 PM
Alright, I got that fixed. But now when I touch the brick the 'player.Name.." Broke this place!"' message doesn't appear. any help on that?
Report Abuse
multrimax is not online. multrimax
Joined: 25 Dec 2009
Total Posts: 10294
11 May 2013 09:42 PM
bump
Report Abuse
multrimax is not online. multrimax
Joined: 25 Dec 2009
Total Posts: 10294
11 May 2013 09:53 PM
bump 2
Report Abuse
WTSHelper1 is not online. WTSHelper1
Joined: 28 Feb 2011
Total Posts: 1721
11 May 2013 09:56 PM
What's the output?
Report Abuse
multrimax is not online. multrimax
Joined: 25 Dec 2009
Total Posts: 10294
11 May 2013 10:00 PM
23:00:30.597 - Workspace.Part.Script:15: attempt to index global 'player' (a nil value)
Report Abuse
multrimax is not online. multrimax
Joined: 25 Dec 2009
Total Posts: 10294
11 May 2013 10:16 PM
Bump
Report Abuse
multrimax is not online. multrimax
Joined: 25 Dec 2009
Total Posts: 10294
11 May 2013 10:34 PM
bump
Report Abuse
multrimax is not online. multrimax
Joined: 25 Dec 2009
Total Posts: 10294
12 May 2013 01:34 AM
bump
Report Abuse
multrimax is not online. multrimax
Joined: 25 Dec 2009
Total Posts: 10294
12 May 2013 10:24 AM
bump
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
12 May 2013 10:57 AM
Allowed = {"multrimax", "coolbob44"}

function isAllowed(hit)
local hum = hit.Parent:FindFirstChild("Humanoid")
local name = hit.Parent.Name
if hum ~= nil then
for i = 1, #Allowed do
if Allowed[i].Name == name then
local g = game.Workspace:GetChildren()
for i = 1, #g do
if g[i].ClassName == "Part" then
g[i].CFrame = CFrame.fromEulerAnglesXYZ(0.9, 0.9, 0.9)
end
end
local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = name.." broke this place!"
wait(4)
m:Destroy()
return
end
end
hum.Health = 0
local a = game.Players:GetPlayerFromCharacter(hit.Parent)
local b = Instance.new("Message")
b.Parent = a.PlayerGui
b.Text = "Go away!"
wait(4)
end
end

script.Parent.Touched:connect(isAllowed)
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