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: I desperately need help with this 3=

Previous Thread :: Next Thread 
march96 is not online. march96
Joined: 28 Apr 2009
Total Posts: 438
16 Jul 2011 08:33 PM
enabled = true
function onHit(hit)
local human = hit.Parent:findFirstChild("Humanoid")

if (human ~= nil) and not enabled then return end
enabled = false
local user = game.Players:findFirstChild(hit.Parent.Name)
if user ~= nil then

local message = script.Parent.Message:clone()

message.ImageLabel.ImageLabel = ""
message.Parent = user.PlayerGui
wait(2)
if message ~= nil then
message:remove()
wait(0.2)
enabled = true
else
wait(0.2)
enabled = true
end
end
end



script.Parent.Touched:connect(onHit)




Can someone fix this script so that when someone steps on a brick an image will appear. I tried to edit this myself,but it doesn't really work.
Report Abuse
OBF is not online. OBF
Joined: 29 Sep 2009
Total Posts: 10709
16 Jul 2011 08:35 PM
enabled = true
function onHit(hit)
local human = hit.Parent:findFirstChild("Humanoid")

if (human ~= nil) and not enabled then return end
enabled = false
local user = game.Players:findFirstChild(hit.Parent.Name)
if user ~= nil then

local message = script.Parent.Message:clone()

message.ImageLabel.Image = ""
message.Parent = user.PlayerGui
wait(2)
if message ~= nil then
message:remove()
wait(0.2)
enabled = true
else
wait(0.2)
enabled = true
end
end
end



script.Parent.Touched:connect(onHit
Report Abuse
march96 is not online. march96
Joined: 28 Apr 2009
Total Posts: 438
16 Jul 2011 08:37 PM
Wow,Idiot..
Report Abuse
OBF is not online. OBF
Joined: 29 Sep 2009
Total Posts: 10709
16 Jul 2011 08:38 PM
If you actually read the script, you'd find what I changed.
Report Abuse
L2000 is not online. L2000
Joined: 03 Apr 2008
Total Posts: 77448
16 Jul 2011 08:39 PM
enabled = true
function onHit(hit)
local human = hit.Parent:findFirstChild("Humanoid")

if (human ~= nil) or not enabled then return end --Or it will end it if either happens; you had it so that it would only end if both happened
enabled = false
local user = game.Players:findFirstChild(hit.Parent.Name)
if user ~= nil then

local message = script.Parent.Message:clone()

message.ImageLabel.ImageLabel.Image = "" --I'm guessing this is changing the image? It would error due to only getting to the label.
message:clone().Parent = user.PlayerGui --You need to clone it, or it will error after one usage.
wait(2)
if message ~= nil then
message:remove()
wait(0.2)
enabled = true
else
wait(0.2)
enabled = true --For the previous few lines, you could have had a end and put wait(0.2) and enabled = true once.
end
end
end



script.Parent.Touched:connect(onHit)
Report Abuse
Scriptishish is not online. Scriptishish
Joined: 16 Oct 2007
Total Posts: 1231
16 Jul 2011 08:40 PM
enabled = true
function onHit(hit)
local human = hit.Parent:findFirstChild("Humanoid")

if human==nil or not enabled then return end
enabled = false
local user = game.Players:playerFromCharacter(hit.Parent.Name)
if user ~= nil then

local message = script.Parent.Message:clone()

message.ImageLabel.ImageLabel = "" --img
message.Parent = user.PlayerGui
wait(2)
if message ~= nil then
message:remove()
wait(0.2)
enabled = true
else
wait(0.2)
enabled = true
end
end
end



script.Parent.Touched:connect(onHit)

You had if humanoid~=nil for return end, you want if it's nil return end.
Report Abuse
march96 is not online. march96
Joined: 28 Apr 2009
Total Posts: 438
16 Jul 2011 08:40 PM
. . . Oh,I see.. I am so sorry! <_> I'm the idiot..
Report Abuse
Scriptishish is not online. Scriptishish
Joined: 16 Oct 2007
Total Posts: 1231
16 Jul 2011 08:43 PM
It happens. I've taken an hour doing countless fixes to a script just to realize I've misspelled one word. lul
Report Abuse
march96 is not online. march96
Joined: 28 Apr 2009
Total Posts: 438
16 Jul 2011 08:54 PM
I thank you all!
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