CPRULEZTop 100 PosterJoin Date: 2007-05-29 Post Count: 3093 |
I need some scripts from mikeds place.... like after 10 minutes it says " "persons name"- (how many points they got)" then again and again. The other script i need is when someone dies, on the leaderboard it minuses points. And when they kill someone, it adds points. Also, at the end of the match it resets and kills everyone, and resets the leaderboard also.
I don't need the paintball gun though, If anyone anyone can help me, i would be very greatful. Thanks! |
|
LuigiFanJoin Date: 2007-06-18 Post Count: 4143 |
Cp I doubt anyone but the pro scripters could even come close to making miked's scripts. And if they can I doubt they'd give it to you XD
=P-LuigiFan-=P |
|
CPRULEZTop 100 PosterJoin Date: 2007-05-29 Post Count: 3093 |
Well, i kno someone who has the EXACT script................ |
|
|
I have some scripts that are very similar to Miked's. Check out the general section for my latest tournament, they are being given away as a prize. |
|
CPRULEZTop 100 PosterJoin Date: 2007-05-29 Post Count: 3093 |
I kno i probably won't be able to make it though........... |
|
|
Is there a time that would be better for you? |
|
tottiJoin Date: 2006-11-02 Post Count: 2684 |
The best way to do this is with two seperate scripts...I will give you both and this includes the leaderboard.
Just put these scripts in workspace seperately
---------------------------------------
--Totti's Game Script
local game_length = 300 -- every X seconds, end the game, show a message, regen the map, rebalance teams, cause MASSIVE LAG
message = nil
function showMessage(text)
-- This function flashes a message to all players
-- Clear the message with hideMessage()
hideMessage() -- Never show more than one message at a time
if message == nil then message = Instance.new("Message") end -- only make a message if we don't have a message object lying around
message.Text = text
message.Parent = game.Workspace
end
function hideMessage()
if message == nil then return end
message.Parent = nil
end
function clearPlayerInfo()
-- resets KOs and WOs
local players = game.Players:children()
for i = 1, #players do
if (players[i]:findFirstChild("leaderstats") ~= nil) and (players[i].leaderstats.KOs ~= nil) then players[i].leaderstats.KOs.Value = 0 end
if (players[i]:findFirstChild("leaderstats") ~= nil) and (players[i].leaderstats.Wipeouts ~= nil) then players[i].leaderstats.Wipeouts.Value = 0 end
end
end
function getWinnerInfo()
-- returns a string that we display to everyone about who the winner is
-- in case of tie, no one wins. if someone wants to code something better, be my guest.
local highscore = 0
local winner = "No one"
local tie = false
local players = game.Players:children()
for i = 1, #players do
local pscore = -1
if players[i]:findFirstChild("leaderstats") ~= nil then
if players[i].leaderstats.Points ~= nil then
pscore = players[i].leaderstats.Points.Value
end
end
if pscore == highscore then
tie = true
end
if pscore > highscore then
-- new highscore
highscore = pscore
winner = players[i].Name
tie = false
end
end
if tie == true then return "There was a tie. How boring." end
local text = string.format("%s %s %d %s", winner, "wins with", highscore, "points!")
return text
end
function getWinningTeamString()
local red = 0
local blue = 0
local p = game.Players:children()
for i=1,#p do
if (p[i].TeamColor == game.Teams:findFirstChild("Blue Falcons").TeamColor) then
if (p[i]:findFirstChild("leaderstats") ~= nil and p[i].leaderstats.KOs ~= nil) then
blue = blue + p[i].leaderstats.KOs.Value
end
end
if (p[i].TeamColor == game.Teams:findFirstChild("Red Hawks").TeamColor) then
if (p[i]:findFirstChild("leaderstats") ~= nil and p[i].leaderstats.KOs ~= nil) then
red = red + p[i].leaderstats.KOs.Value
end
end
end
if (red == blue) then return "Red and Blue tied. How boring!" end
if (red > blue) then return string.format("Red won the match by %d points!", red - blue) end
return string.format("Blue won the match by %d points!", blue - red)
end
while true do
wait(game_length - 30)
showMessage("30 seconds left until end of game!")
wait(5)
hideMessage()
wait(25)
showMessage("Rebalancing teams and launching new game...")
wait(5)
clearPlayerInfo()
game.Teams:rebalanceTeams()
hideMessage()
end
-----------------------------------------------
Now this is the second one
-----------------------------------------------
-- Totti's custom leaderboard
print("Leaderboard script version 4.00 loaded")
function onPlayerEntered(newPlayer)
local TKs = Instance.new("IntValue")
TKs.Name = "TeamKills"
TKs.Value = 0
TKs.Parent = newPlayer
local stats = Instance.new("IntValue")
stats.Name = "leaderstats"
local kills = Instance.new("IntValue")
kills.Name = "Points"
kills.Value = 0
local deaths = Instance.new("IntValue")
deaths.Name = "Points"
deaths.Value = 0
kills.Parent = stats
deaths.Parent = stats
-- VERY UGLY HACK
-- Will this leak threads?
-- Is the problem even what I think it is (player arrived before character)?
while true do
if newPlayer.Character ~= nil then break end
wait(5)
end
local humanoid = newPlayer.Character.Humanoid
humanoid.Died:connect(function() onHumanoidDied(humanoid, newPlayer) end )
-- start to listen for new humanoid
newPlayer.Changed:connect(function(property) onPlayerRespawn(property, newPlayer) end )
stats.Parent = newPlayer
end
--function checkTKs(victim, killer)
-- print("CHECK TKS")
-- if (killer == nil) then return end
-- if (victim == killer) then return end
-- if (victim.Team == killer.Team and killer:findFirstChild("TeamKills") ~= nil) then
-- killer.TeamKills.Value = killer.TeamKills.Value + 1
-- print("TK++")
-- show an appropraite msg
-- local msg = Instance.new("Message")
-- if (killer.TeamKills.Value == 1) then msg.Text = "Try not to blox your team mates!" end
-- if (killer.TeamKills.Value == 2) then msg.Text = "WARNING: blox your team, go to jail!" end
-- if (killer.TeamKills.Value > 2) then
-- Jail time
-- msg.Text = "JAIL TIME!"
-- killer.Character.Humanoid.Health = 0
-- end
-- msg.Parent = killer
-- wait(5)
-- msg.Parent = nil
--end
--end
function Send_DB_Event_Died(victim, killer)
-- killer may be nil
local killername = "no one"
if killer ~= nil then killername = killer.Name end
print("DIED EVENT: ", victim.Name, " KILLED by ", killername)
if shared["deaths"] ~= nil then
shared["deaths"](victim, killer)
print("SENT DB DEATH EVENT")
end
end
function Send_DB_Event_Kill(killer, victim)
print("KILL EVENT. ", killer.Name, " BLOXXED ", victim.Name)
if shared["kills"] ~= nil then
shared["kills"](killer, victim)
print("SENT DB KILL EVENT")
end
end
function onHumanoidDied(humanoid, player)
local stats = player:findFirstChild("leaderstats")
if stats ~= nil then
local deaths = stats:findFirstChild("Points")
deaths.Value = deaths.Value - 5
-- do short dance to try and find the killer
local killer = getKillerOfHumanoidIfStillInGame(humanoid)
--checkTKs(player, killer)
Send_DB_Event_Died(player, killer)
handleKillCount(humanoid, player)
end
end
function onPlayerRespawn(property, player)
-- need to connect to new humanoid
if property == "Character" and player.Character ~= nil then
local humanoid = player.Character.Humanoid
local p = player
local h = humanoid
humanoid.Died:connect(function() onHumanoidDied(h, p) end )
end
end
function getKillerOfHumanoidIfStillInGame(humanoid)
-- returns the player object that killed this humanoid
-- returns nil if the killer is no longer in the game
-- check for kill tag on humanoid - may be more than one - todo: deal with this
local tag = humanoid:findFirstChild("creator")
-- find player with name on tag
if tag ~= nil then
local killer = tag.Value
if killer.Parent ~= nil then -- killer still in game
return killer
end
end
return nil
end
function handleKillCount(humanoid, player)
local killer = getKillerOfHumanoidIfStillInGame(humanoid)
if killer ~= nil then
local stats = killer:findFirstChild("leaderstats")
if stats ~= nil then
local kills = stats:findFirstChild("Points")
if killer ~= player then
kills.Value = kills.Value + 10
else
kills.Value = kills.Value - 5
end
Send_DB_Event_Kill(killer, player)
end
end
end
game.Players.ChildAdded:connect(onPlayerEntered)
------------------------------------------
There you go! Hope it works for you and enjoy!
P.S.(I kinda whipped this up real quick so I dunno if it works or not)
Totti |
|
CPRULEZTop 100 PosterJoin Date: 2007-05-29 Post Count: 3093 |
Works great, but the only problem is that when i die, it doesnt take away points. |
|
tottiJoin Date: 2006-11-02 Post Count: 2684 |
hm...I will check out an alternative real quick
Totti |
|
tottiJoin Date: 2006-11-02 Post Count: 2684 |
Try this!
----------------------------------------------------
-- Totti's custom leaderboard
print("Leaderboard script version 4.00 loaded")
function onPlayerEntered(newPlayer)
local TKs = Instance.new("IntValue")
TKs.Name = "TeamKills"
TKs.Value = 0
TKs.Parent = newPlayer
local stats = Instance.new("IntValue")
stats.Name = "leaderstats"
local kills = Instance.new("IntValue")
kills.Name = "Points"
kills.Value = 0
local deaths = Instance.new("IntValue")
deaths.Name = "Points"
deaths.Value = 0
kills.Parent = stats
deaths.Parent = stats
-- VERY UGLY HACK
-- Will this leak threads?
-- Is the problem even what I think it is (player arrived before character)?
while true do
if newPlayer.Character ~= nil then break end
wait(5)
end
local humanoid = newPlayer.Character.Humanoid
humanoid.Died:connect(function() onHumanoidDied(humanoid, newPlayer) end )
-- start to listen for new humanoid
newPlayer.Changed:connect(function(property) onPlayerRespawn(property, newPlayer) end )
stats.Parent = newPlayer
end
--function checkTKs(victim, killer)
-- print("CHECK TKS")
-- if (killer == nil) then return end
-- if (victim == killer) then return end
-- if (victim.Team == killer.Team and killer:findFirstChild("TeamKills") ~= nil) then
-- killer.TeamKills.Value = killer.TeamKills.Value + 1
-- print("TK++")
-- show an appropraite msg
-- local msg = Instance.new("Message")
-- if (killer.TeamKills.Value == 1) then msg.Text = "Try not to blox your team mates!" end
-- if (killer.TeamKills.Value == 2) then msg.Text = "WARNING: blox your team, go to jail!" end
-- if (killer.TeamKills.Value > 2) then
-- Jail time
-- msg.Text = "JAIL TIME!"
-- killer.Character.Humanoid.Health = 0
-- end
-- msg.Parent = killer
-- wait(5)
-- msg.Parent = nil
--end
--end
function Send_DB_Event_Died(victim, killer)
-- killer may be nil
local killername = "no one"
if killer ~= nil then killername = killer.Name end
print("DIED EVENT: ", victim.Name, " KILLED by ", killername)
if shared["deaths"] ~= nil then
shared["deaths"](victim, killer)
print("SENT DB DEATH EVENT")
end
end
function Send_DB_Event_Kill(killer, victim)
print("KILL EVENT. ", killer.Name, " BLOXXED ", victim.Name)
if shared["kills"] ~= nil then
shared["kills"](killer, victim)
print("SENT DB KILL EVENT")
end
end
function onHumanoidDied(humanoid, player)
local stats = player:findFirstChild("leaderstats")
if stats ~= nil then
local deaths = stats:findFirstChild("Points")
kills.Value = kills.Value - 5
-- do short dance to try and find the killer
local killer = getKillerOfHumanoidIfStillInGame(humanoid)
--checkTKs(player, killer)
Send_DB_Event_Died(player, killer)
handleKillCount(humanoid, player)
end
end
function onPlayerRespawn(property, player)
-- need to connect to new humanoid
if property == "Character" and player.Character ~= nil then
local humanoid = player.Character.Humanoid
local p = player
local h = humanoid
humanoid.Died:connect(function() onHumanoidDied(h, p) end )
end
end
function getKillerOfHumanoidIfStillInGame(humanoid)
-- returns the player object that killed this humanoid
-- returns nil if the killer is no longer in the game
-- check for kill tag on humanoid - may be more than one - todo: deal with this
local tag = humanoid:findFirstChild("creator")
-- find player with name on tag
if tag ~= nil then
local killer = tag.Value
if killer.Parent ~= nil then -- killer still in game
return killer
end
end
return nil
end
function handleKillCount(humanoid, player)
local killer = getKillerOfHumanoidIfStillInGame(humanoid)
if killer ~= nil then
local stats = killer:findFirstChild("leaderstats")
if stats ~= nil then
local kills = stats:findFirstChild("Points")
if killer ~= player then
kills.Value = kills.Value + 10
else
kills.Value = kills.Value - 5
end
Send_DB_Event_Kill(killer, player)
end
end
end
game.Players.ChildAdded:connect(onPlayerEntered)
---------------------------------------------------------
Also if you have a paintball place this might bee a useful script..if it works that is lol
------------------
function onPlayerRespawned(newPlayer)
h = newPlayer.Character:findFirstChild("Humanoid")
h.MaxHealth = #INF
h.Health = h.MaxHealth
wait(4)
h.MaxHealth = 100
h.Health = h.MaxHealth
end
function onPlayerEntered(newPlayer)
newPlayer.Changed:connect(function (property)
if (property == "Character") then
onPlayerRespawned(newPlayer)
end
end
game.Players.PlayerAdded:connect(onPlayerEntered)
--------------------
That script should make players invincible when they spawn for 4 seconds!
(It is untested so I have no clue whether it works or not)
Enjoy!
Totti |
|
CPRULEZTop 100 PosterJoin Date: 2007-05-29 Post Count: 3093 |
The leaderboard doesn't seem to work........ |
|
tottiJoin Date: 2006-11-02 Post Count: 2684 |
Ya...and I can't figure out why because edit mode isn't working =/
Totti |
|
cruckshankTop 100 PosterJoin Date: 2007-07-10 Post Count: 1936 |
i think i see why just let me duble check |
|
cruckshankTop 100 PosterJoin Date: 2007-07-10 Post Count: 1936 |
hmmm sorry it could be simple spelling mistake or half way thru im not a greate scripter but u put a "#" |
|
CPRULEZTop 100 PosterJoin Date: 2007-05-29 Post Count: 3093 |
Just try to work on it........... ok? Ohhh.. and i cant maake it because i am really bad at timeing and I probablywon't be home or something............... |
|
|
I need a scripter in my group could you be for the job? |
|