|
For example the disaster in StickMasterLuke's Disaster Survival when the flood happens. You know how the floodwater slowly drowns you? I need help with this because other scripts either still damage you when not touching the brick or stops damaging you while in the brick.
my attempt:
local debounce = false
script.Parent.Touched:connect(function (hit)
if not debounce then debounce = true
guy = hit.Parent:FindFirstChild("Humanoid")
if guy ~= nil then
--[[Next line is optional, it just makes the person unable to move.
guy.Torso.Anchored = true]]--
guy.Health = guy.Health - 5
wait(0.01)
debounce = true
end
end
end) |
|
TigeonJoin Date: 2013-05-24 Post Count: 4222 |
i dont know how to script but something like this
Health -10
wait (1)
Health -10
so on |
|
|
Why does no one end up helping me with my stuff this is the worst forum ever and thanks hockey but it didnt work. |
|
|
It's so simple no one can even tell me how to make a brick slowly damage me? Seriously? |
|
|
Go to the scripters forum? No **** they're not helping you at the "Game Design" forum while there's a whole forum made for scripting itself and it's issues. |
|
HibobbJoin Date: 2010-04-18 Post Count: 2146 |
You could do something such as:
touching = false
player = nil
script.Parent.Touched:connect(function(hit)
hum = hit.Parent:FindFirstChild("Humanoid")
if hum then
player = hit.Parent
touching = true
while touching do
wait(1)
if player then
if player.Humanoid.Health > 0 then
player.Humanoid.Health = player.Humanoid.Health - 5
end
end
end
end
end)
script.Parent.TouchEnded:connect(function(hit)
if player then
if hit.Parent == player then
player = nil
touching = false
end
end
end) |
|
|
Thanks hibbob and Merchanting hope you get over your anger management lol |
|
|
HibobbJoin Date: 2010-04-18 Post Count: 2146 |
|
|
|
I've only answered your stupid question, I dont need to "get over my anger managemnent" you were stupid enough to come with a script on a game design forum. |
|
|
"Why does no one end up helping me with my stuff this is the worst forum ever" |
|
|
The scripting forum is not for help. It's for discussion. |
|
ScriptosJoin Date: 2008-06-17 Post Count: 2900 |
@Merchanting;
Read the description of the Scripters forum.
"This is a place for discussion about scripting. Anything about scripting that is not a help request or topic belongs here."
This is a help request. |
|
SulfoneJoin Date: 2010-08-19 Post Count: 8046 |
@Merchanting
The mods have said that Game Design is the correct sub-forum for scripting help, not Scripters. Even if you have never seen a mod, you should probably had read Scripter's description before calling others stupid. |
|
|
Lol no, I do/say whatever I want. I couldn't care less about what you have to say. |
|
ScriptosJoin Date: 2008-06-17 Post Count: 2900 |
Then please, continue being wrong. |
|
|
I'm a very noob scripter, but I think you basically insert a damage script with wait.
(Damage script here)
Wait(Desired number here)
(Damage script again)
Wait(#)
(Script)
Wait(#) |
|
|
Yeah, will do. Wrong forum. |
|
AesuraJoin Date: 2008-03-08 Post Count: 23339 |
worst kind of being stubborn - in face of pure evidence |
|
AesuraJoin Date: 2008-03-08 Post Count: 23339 |
though OP did throw a tantrum lolol |
|
|