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 » Scripters
Home Search
 

Re: Need help with a script!

Previous Thread :: Next Thread 
ElGuapoLoco is not online. ElGuapoLoco
Joined: 01 Aug 2015
Total Posts: 53
02 Aug 2015 03:46 PM
hello this script doesn't delete itself after 16 seconds, I wonder why, can't find a solution:

c=script.Parent
p=game.Players:GetPlayerFromCharacter(c)
local Sound=Instance.new("Sound")
Sound.SoundId="http://www.roblox.com/asset/?id=171521422"
Sound.Parent=script
Sound.Name="HeartBeat"
Sound.Volume=0.6
Sound.Looped=false

local origFace=c.Head.face
origFace.Parent=nil
local newFace=Instance.new("Decal")
newFace.Texture="http://www.roblox.com/asset/?id=29109680"
newFace.Parent=c.Head
newFace.Face="Front"

local q=Instance.new("ImageLabel")
q.Image="http://www.roblox.com/asset/?id=278713031"
q.Size=UDim2.new(1,0,1,0)
q.Transparency=1
q.Name="BloodEye"
if p.PlayerGui:findFirstChild("GuiMain")==nil then
local gm=Instance.new("GuiMain")
gm.Parent=p.PlayerGui
q.Parent=gm
else
q.Parent=p.PlayerGui.GuiMain
end

c.Humanoid.MaxHealth=200
wait(0.001)
c.Humanoid.Health=200
c.Humanoid.WalkSpeed=10

for i=1,2 do
Sound:Play()
wait(16)
end
wait(16)

c.Humanoid.MaxHealth=random(100,0)
wait(0.001)
c.Humanoid.Health=random(100,0)
c.Humanoid.WalkSpeed=16
wait(16)
q:remove()
w:remove()
newFace:remove()
origFace.Parent=c.Head
origFace.Face="Front"
script:remove()

can someone help me out?
Report Abuse
ElGuapoLoco is not online. ElGuapoLoco
Joined: 01 Aug 2015
Total Posts: 53
02 Aug 2015 03:52 PM
i mean, it's a gui that appears on your screen.. it's cool for 16 seconds but then it's almost impossible to see with that gui on your screen, but i really don't know where i went wrong, the :remove() functions are all there
Report Abuse
ElGuapoLoco is not online. ElGuapoLoco
Joined: 01 Aug 2015
Total Posts: 53
02 Aug 2015 03:57 PM
b2
Report Abuse
WoolHat is online. WoolHat
Joined: 19 May 2013
Total Posts: 1873
02 Aug 2015 03:58 PM
It might only solve one of your problems, but.
Okay, two little fixes here, lol.
Use :Destroy(). I hear it's much better for a place.

And, the last :remove() you have, you're only removing the script. It sounds like you're trying to remove the Gui. So:
script.Parent:Destroy() --or whatever is the index of the Gui you want to delete
Report Abuse
ElGuapoLoco is not online. ElGuapoLoco
Joined: 01 Aug 2015
Total Posts: 53
02 Aug 2015 04:01 PM
yeah i'll use destroy, btw,

> local q=Instance.new("ImageLabel") -- is the GUI i want to get rid of

> q:Destroy() -- i asked the script to delete it, but nothing happens
Report Abuse
ElGuapoLoco is not online. ElGuapoLoco
Joined: 01 Aug 2015
Total Posts: 53
02 Aug 2015 04:05 PM
nothing changes
Report Abuse
ElGuapoLoco is not online. ElGuapoLoco
Joined: 01 Aug 2015
Total Posts: 53
02 Aug 2015 04:13 PM
b4
Report Abuse
WoolHat is online. WoolHat
Joined: 19 May 2013
Total Posts: 1873
02 Aug 2015 04:23 PM
Fixed what I could. You're still going to have some problems with some stuff, probably. Try to make some more defining variables next time. Also: Huge difference between Character and Player (your c and p). You had both set to find the Player

c= script.Parent.Parent.Character
p= game.Players:GetPlayerFromCharacter(c)
local Sound=Instance.new("Sound")
Sound.SoundId="http://www.roblox.com/asset/?id=171521422"
Sound.Parent=script
Sound.Name="HeartBeat"
Sound.Volume=0.6
Sound.Looped=false

local origFace=c.Head.face
origFace.Parent=nil
local newFace=Instance.new("Decal")
newFace.Texture="http://www.roblox.com/asset/?id=29109680"
newFace.Parent=c.Head
newFace.Face="Front"

local q=Instance.new("ImageLabel")
q.Image="http://www.roblox.com/asset/?id=278713031"
q.Size=UDim2.new(1,0,1,0)
q.Transparency=1
q.Name="BloodEye"
if p.PlayerGui:findFirstChild("GuiMain")==nil then
gm=Instance.new("GuiMain")
gm.Parent=p.PlayerGui
q.Parent=gm
else
q.Parent=p.PlayerGui.GuiMain
end

c.Humanoid.MaxHealth=200
wait(0.001)
c.Humanoid.Health=200
c.Humanoid.WalkSpeed=100

for i=1,2 do
Sound:Play()
wait(16)
end

c.Humanoid.MaxHealth=math.random(0,100)
wait(0.001)
c.Humanoid.Health=math.random(0,100)
c.Humanoid.WalkSpeed=16
wait(16)
q:Destroy()
newFace:Destroy()
origFace.Parent=c.Head
origFace.Face="Front"
gm:Destroy()
script:Destroy()
Report Abuse
ElGuapoLoco is not online. ElGuapoLoco
Joined: 01 Aug 2015
Total Posts: 53
02 Aug 2015 04:24 PM
ok thanks a lot mate, i'm gonna test it, also, if you want, i can make you a discount for what i sell there:

http://www.roblox.com/games/278125426/mexican-perfect-legit-business-no-drgs
Report Abuse
WoolHat is online. WoolHat
Joined: 19 May 2013
Total Posts: 1873
02 Aug 2015 04:28 PM
That is absolutely fantastic
Report Abuse
ElGuapoLoco is not online. ElGuapoLoco
Joined: 01 Aug 2015
Total Posts: 53
02 Aug 2015 04:35 PM
sorry lost connection, also glad you liked it
Report Abuse
ElGuapoLoco is not online. ElGuapoLoco
Joined: 01 Aug 2015
Total Posts: 53
02 Aug 2015 04:40 PM
now it doesn't do anything at all lol
Report Abuse
WoolHat is online. WoolHat
Joined: 19 May 2013
Total Posts: 1873
02 Aug 2015 04:44 PM
Did you put it into a local script in StarterGui?
Report Abuse
ElGuapoLoco is not online. ElGuapoLoco
Joined: 01 Aug 2015
Total Posts: 53
02 Aug 2015 04:50 PM
nope, you saw it, it's a tool that when it's used triggers a script that enables the script i wrote on this forum, so it's a normal script inside a tool
Report Abuse
WoolHat is online. WoolHat
Joined: 19 May 2013
Total Posts: 1873
02 Aug 2015 05:25 PM
Have no idea if this will still play for the whole server, but I made the thing.
local c= script.Parent.Parent
local p= game.Players:GetPlayerFromCharacter(c)
local Sound=Instance.new("Sound")
Sound.SoundId="http://www.roblox.com/asset/?id=171521422"
Sound.Parent=p.PlayerGui
Sound.Name="HeartBeat"
Sound.Volume=0.6
Sound.Looped=false

local origFace=c.Head.face
origFace.Parent=nil
local newFace=Instance.new("Decal")
newFace.Texture="http://www.roblox.com/asset/?id=29109680"
newFace.Parent=c.Head
newFace.Face="Front"
local q=Instance.new("ImageLabel")
q.Image="http://www.roblox.com/asset/?id=278713031"
q.Size=UDim2.new(1,0,1,0)
q.Transparency=1
q.Name="BloodEye"
if p.PlayerGui:findFirstChild("GuiMain")==nil then
gm=Instance.new("GuiMain")
gm.Parent=p.PlayerGui
q.Parent=gm
else
q.Parent=p.PlayerGui.GuiMain
end

c.Humanoid.MaxHealth=200
wait(0.001)
c.Humanoid.Health=200
c.Humanoid.WalkSpeed=8

for i=1,2 do
Sound:Play()
wait(2)
end

c.Humanoid.MaxHealth=math.random(0,100)
wait(0.001)
c.Humanoid.Health=math.random(0,100)
c.Humanoid.WalkSpeed=16
Sound:Stop()
Sound:Destroy()
q:Destroy()
newFace:Destroy()
origFace.Parent=c.Head
origFace.Face="Front"
gm:Destroy()
end
Report Abuse
ElGuapoLoco is not online. ElGuapoLoco
Joined: 01 Aug 2015
Total Posts: 53
03 Aug 2015 12:43 PM
doesn't do anything lol
Report Abuse
ElGuapoLoco is not online. ElGuapoLoco
Joined: 01 Aug 2015
Total Posts: 53
04 Aug 2015 03:57 AM
bump..
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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