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: Disaster Game - points not adding

Previous Thread :: Next Thread 
AvadaKedavra10 is not online. AvadaKedavra10
Joined: 02 Aug 2011
Total Posts: 194
15 Jun 2013 09:41 AM
I made a disaster game, the scripts for the disasters seem fine but i'm testing it and when I survive a disaster it doesn't come up with a message saying "PLAYER survived", neither does it add points. I think the script could be missing.

Can anyone write me up a little script of when surviving a disaster a message comes up to inform which players survived and another that adds X amount of points (could you leave that for me to change?)

Thank you to anyone who helps.
Report Abuse
stephen1182 is not online. stephen1182
Joined: 31 Aug 2010
Total Posts: 4003
15 Jun 2013 09:42 AM
How much are you willing to pay?
Report Abuse
AvadaKedavra10 is not online. AvadaKedavra10
Joined: 02 Aug 2011
Total Posts: 194
15 Jun 2013 09:46 AM
What do you mean?
Report Abuse
stephen1182 is not online. stephen1182
Joined: 31 Aug 2010
Total Posts: 4003
15 Jun 2013 09:47 AM
lol jk.

I'll make it.
Report Abuse
AvadaKedavra10 is not online. AvadaKedavra10
Joined: 02 Aug 2011
Total Posts: 194
15 Jun 2013 09:50 AM
Okay, thank you. Could you PM it to me just incase this thread gets buried?
Report Abuse
AvadaKedavra10 is not online. AvadaKedavra10
Joined: 02 Aug 2011
Total Posts: 194
15 Jun 2013 09:55 AM
Wait, I just found that it only tells me when nobody has survived. I still need the points and "Playername survived!" thing though.
Report Abuse
AvadaKedavra10 is not online. AvadaKedavra10
Joined: 02 Aug 2011
Total Posts: 194
15 Jun 2013 11:51 AM
Erm bump. It seems this guy went offline so..
Report Abuse
darkero99 is not online. darkero99
Joined: 11 Mar 2011
Total Posts: 399
15 Jun 2013 11:52 AM
First of all, if your script works, give me it. I will make a few tweaks to change the name, and to whom it will show to.

Wreckerbuster67| The Apocalypse Imperium Supreme Overlord, 2iC| Conquest Private 1st Class
Report Abuse
AvadaKedavra10 is not online. AvadaKedavra10
Joined: 02 Aug 2011
Total Posts: 194
15 Jun 2013 12:51 PM
No. I don't have a script - I don't understand LUA at all. I had someone make the rest I just need the points adding and the "______ survived" part.
Report Abuse
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
15 Jun 2013 12:54 PM
Get out noob.
It's scripting helpers not makers.
Report Abuse
AvadaKedavra10 is not online. AvadaKedavra10
Joined: 02 Aug 2011
Total Posts: 194
15 Jun 2013 12:55 PM
Yeah well I need help then. Unless you can explain every single basic of LUA quickly nd me understanding it there's no way my game will work.
Report Abuse
Fattycat17 is not online. Fattycat17
Joined: 26 Jun 2011
Total Posts: 1527
15 Jun 2013 12:56 PM
LMaD is a better place for request

1.) What is LUA? I only know Lua.
Report Abuse
AvadaKedavra10 is not online. AvadaKedavra10
Joined: 02 Aug 2011
Total Posts: 194
15 Jun 2013 12:59 PM
I meant Lua, what's the difference though lol? it's only capitalized, I thought it was LUA anyway.
Report Abuse
IAmReallyAwesome is not online. IAmReallyAwesome
Joined: 05 Mar 2010
Total Posts: 7371
15 Jun 2013 12:59 PM
lol, my friend, it doesn't exactly work that way.

Anyway, we need the disaster script to add the section that adds points.
Report Abuse
AvadaKedavra10 is not online. AvadaKedavra10
Joined: 02 Aug 2011
Total Posts: 194
15 Jun 2013 01:03 PM
Okay I have two scripts -


1) This is the announcement one -

---------- For Announcing Who Survived
feedbackEnabled = true
function feedback(parent, message)
if not feedbackEnabled then return end
local h = parent:findFirstChild("announcement")
if h ~= nil then
h.Text = message
else
h = Instance.new("Message")
h.Name = "announcement"
h.Text = message
h.Parent = parent
end
end

function removeFeedback(parent, delay)
local h = parent:findFirstChild("announcement")
if h ~= nil then
local txt = h.Text
wait(delay)
if h ~= nil and h.Text == txt then -- Make sure that there is not more feedback.
h:remove()
end
end
end

function compilePlayers(players)
local names = ""
if #players == 1 then return players[1].Name end
for i=1,#players do
if i == #players then
names = names.. "and ".. players[i].Name
else
names = names.. players[i].Name.. ", "
end
end
return names
end
----------

function setTag(parent, type, name, value)

local tag = parent:findFirstChild(name)
if tag ~= nil then
if tag.className == type then
tag.Value = value
else
local newTag = Instance.new(type)
newTag.Name = name
newTag.Value = value
newTag.Parent = parent
end
else
local newTag = Instance.new(type)
newTag.Name = name
newTag.Value = value
newTag.Parent = parent
end
end

function getTag(parent, type, name, default)

local tag = parent:findFirstChild(name)
if tag ~= nil then
if tag.className == type then
return tag.Value
else
print("No tag of the specified name and class was found in ", parent)
return default
end
else
print("No tag named ", name, " found in ", parent)
return default
end
end

function died(player, humanoid)
if player ~= nil then
if humanoid ~= nil then
if humanoid.Health == 0 then
setTag(player, "BoolValue", "survived", false)
end
else
setTag(player, "BoolValue", "survived", false)
end
end
end

running = true
function start()
local players = game.Players:getChildren()
local connections = {}

running = true

for i=1,#players do
if players[i].Character ~= nil then
setTag(players[i], "BoolValue", "survived", true)
table.insert(connections, players[i].Character.Humanoid.Changed:connect(function () died(players[i], players[i].Character.Humanoid) end))
end
end

while running do
wait(1)
end

players = game.Players:getChildren()
local survivedt = {}

for i=1,#players do
local survived = getTag(players[i], "BoolValue", "survived", false)
if survived then
setTag(players[i]:findFirstChild("leaderstats"), "IntValue", "Survivals", getTag(players[i]:findFirstChild("leaderstats"), "IntValue", "Survivals", 0) + 1)
setTag(players[i]:findFirstChild("leaderstats"), "IntValue", "Points", getTag(players[i]:findFirstChild("leaderstats"), "IntValue", "Points", 0) + bin.points.Value)
table.insert(survivedt, players[i])
end
end
bin.points.Value = 0



for i=1,#connections do -- Disconnect all previous connections.
connections[i]:disconnect()
end

if #survivedt > 0 then
feedback(game.Workspace, compilePlayers(survivedt).. " survived.")
else
feedback(game.Workspace, "Nobody Survived!")
end
removeFeedback(game.Workspace, 3)
end

function runningChanged(run)
print("Running Changed")
if run.Value == true then
start()
else
running = false
end
end

function newPlayer(player)
local stats = Instance.new("IntValue")
stats.Name = "leaderstats"

local points = Instance.new("IntValue")
points.Name = "Points"
points.Value = 0

local survivals = Instance.new("IntValue")
survivals.Name = "Survivals"
survivals.Value = 0

points.Parent = stats
survivals.Parent = stats
stats.Parent = player
end

game.Players.ChildAdded:connect(newPlayer)
bin.running.Changed:connect(function () runningChanged(bin.running) end)
print("Leaderboard Loaded")

2) This is the disasters (some of this is from the FurryFox's disaster kit script) -

disasters = {"Noob","Zombies"} -- This is where you list the names models that you want to use for disasters.
-- The list must look like this {"Model","Model","Model","Model","Model"} and so on.
-- Disaster names are case-sensitive and all disaster models must be in the lighting

countdownTime = 10 -- The ammount of time to wait between each disaster.
disasterTime = 30 -- The ammount of time that the disaster will be in the game before it is removed.

countdownMessage = "The next disaster will occur in %s seconds." -- The message displayed between disasters. %s will be replaced with the number of seconds left.
disasterMessage = "Disaster: %s" -- The message displayed when a disaster occurs. %s will be replaced with the disaster name. Set to nil if you do not want a message

-- Unless you know what you are doing, please leave the below code alone.
items = {}
leaderboard = game.Workspace:findFirstChild("BTS Leaderboard") -- Used to work with my BTS leaderboard
local w = game.Workspace:getChildren()
for i=1,#w do
if w[i].Name == "leaderboard" and w[i]:findFirstChild("running") ~= nil and w[i]:findFirstChild("points") ~= ni then
leaderboard = w[i]
end
end
for i=1,#disasters do
local item = game.Lighting:findFirstChild(disasters[i])
if item ~= nil then
item.Parent = nil
table.insert(items, item)
else
print("Error! ", disasters[i], " was not found!")
end
end

function chooseDisaster()
return items[math.random(#items)]
end

function sethint(text)
local hint = game.Workspace:findFirstChild("hint")
if (hint ~= nil) then
hint.Text = text
else
print("Hint does not exist, creating...")
h = Instance.new("Hint")
h.Name = "hint"
h.Text = text
h.Parent = game.Workspace
end
--print("Hint set to: ", text)
end

function removeHint()
hint = game.Workspace:findFirstChild("hint")
if (hint ~= nil) then hint:remove() end
end

function countdown(time)
sethint(string.format(countdownMessage, tostring(time)))
while (time > 0) do
wait(1)
time = time - 1
sethint(string.format(countdownMessage, tostring(time)))
end
removeHint()
return true
end

while true do
countdown(countdownTime)

if leaderboard ~= nil and leaderboard:findFirstChild("running") and leaderboard:findFirstChild("points") then -- For use with my BTS leaderboard.
leaderboard.points.Value = 30 --Points after you survive disasters.
leaderboard.running.Value = true
end

local m = chooseDisaster():clone()

if disasterMessage ~= nil then
local msg = Instance.new("Message")
msg.Name = "DisasterMsg"
msg.Text = string.format(disasterMessage, m.Name)
msg.Parent = game.Workspace
wait(3)
msg.Parent = nil
end

m.Parent = game.Workspace
m:makeJoints()
wait(disasterTime)
m:remove()

if leaderboard ~= nil then -- For use with the bts leaderboard.
leaderboard.running.Value = false
end
end




Report Abuse
Fattycat17 is not online. Fattycat17
Joined: 26 Jun 2011
Total Posts: 1527
15 Jun 2013 01:14 PM
Wow well done using free models!

Lua doesn't stand for anything therefore it is spelled out Lua.
Report Abuse
AvadaKedavra10 is not online. AvadaKedavra10
Joined: 02 Aug 2011
Total Posts: 194
15 Jun 2013 01:16 PM
Rofl. Okay. Well the model is there, why not use it? I want a popular game and the points won't add. I followed a youtube tutorial when doing it..

Obviously I will add more to it so that it's original but yeah.. I need the base game first.
Report Abuse
AvadaKedavra10 is not online. AvadaKedavra10
Joined: 02 Aug 2011
Total Posts: 194
16 Jun 2013 04:52 AM
Bump.. still need help.
Report Abuse
digpoe is not online. digpoe
Joined: 02 Nov 2008
Total Posts: 9092
16 Jun 2013 06:24 AM
'I think the script could be missing.'
Call the police! We've got a wild script on the run!
Report Abuse
AvadaKedavra10 is not online. AvadaKedavra10
Joined: 02 Aug 2011
Total Posts: 194
16 Jun 2013 08:40 AM
Ehh.. please don't make jokes I just need the script.
Report Abuse
Ahmed12971 is not online. Ahmed12971
Joined: 14 Sep 2012
Total Posts: 53
14 Nov 2013 10:29 AM
Avada If u Read The Script Called Read Me on 1 of the starter kits 1 of the instructions says u MUST put BTS learderboard in workspace. try it I hope it works :D
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