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: If any of you can fix this script I will be amazed :l (So yes, can you help me out?)

Previous Thread :: Next Thread 
Jammintoad is online. Jammintoad
Joined: 08 Feb 2009
Total Posts: 10239
27 Jan 2012 06:08 PM
What these scripts are supposed to do and what they are: These are both linked to 2 buttons, that when pressed, are supposed to add one point to the team of the person pressed, if that person is on a certain team, then display 2 messages, one saying that a team won a round, and then a message with a score of both teams.

What's wrong: It works fine the 1st time I take my character to the button and press it. The 2nd time, I get the "Not part of the team" message in the ouput. (As in, the if requirements were not passed the 2nd time) Mind you, I'm doing this with the same character the 2nd time I go back to the button.


------------------------------Tournament buttons------------------------------

db = false
function jalepenopoint(hit)
print("Function started to run")
if hit.Parent:findFirstChild("Humanoid") and game.Players:playerFromCharacter(hit.Parent).TeamColor==BrickColor.new("Bright blue") and shared.tournamentactivated == true and db == false then --change this to the teamcolor of the team you want to be able to open this door
db = true
hit.Parent:BreakJoints() --Kills humanoid
local h = Instance.new("Message") --Makes message
h.Parent = Workspace --Puts message where all can see
h.Text = "The Jalepenos have won the round!" --Changes message words
shared.c = shared.c + 1 --Changes score
wait(5)
h:Destroy()
local l = Instance.new("Message")
l.Parent = Workspace
l.Text = "The Bagels current score is now " ..shared.e.. " and the Jalepenos is " ..shared.c.. "!"
wait(7)
l:Destroy()
db = false
else
print("Not part of the team")
end
end

Workspace.TournamentSetup.jalepenowin.Touched:connect(jalepenopoint)

dba = false
function bagelpoint(hit)
print("Function started to run")
if hit.Parent:findFirstChild("Humanoid") and game.Players:playerFromCharacter(hit.Parent).TeamColor==BrickColor.new("Bright blue") and shared.tournamentactivated == true and dba == false then --change this to the teamcolor of the team you want to be able to open this door
dba = true
hit.Parent:BreakJoints() --Kills humanoid
local h = Instance.new("Message") --Makes message
h.Parent = Workspace --Puts message where all can see
h.Text = "The Jalepenos have won the round!" --Changes message words
shared.c = shared.c + 1 --Changes score
wait(5)
h:Destroy()
local l = Instance.new("Message")
l.Parent = Workspace
l.Text = "The Bagels current score is now " ..shared.e.. " and the Jalepenos is " ..shared.c.. "!"
wait(7)
l:Destroy()
dba = false
else
print("Not part of the team")
end
end

Workspace.TournamentSetup.bagelwin.Touched:connect(bagelpoint)
Report Abuse
Jammintoad is online. Jammintoad
Joined: 08 Feb 2009
Total Posts: 10239
27 Jan 2012 06:28 PM
Bump.
Report Abuse
Jammintoad is online. Jammintoad
Joined: 08 Feb 2009
Total Posts: 10239
27 Jan 2012 06:58 PM
Bump.
Report Abuse
damanofrunescape is not online. damanofrunescape
Joined: 29 Jul 2008
Total Posts: 7338
27 Jan 2012 07:00 PM
What is the players TeamColor the first time?
Report Abuse
Jammintoad is online. Jammintoad
Joined: 08 Feb 2009
Total Posts: 10239
27 Jan 2012 07:04 PM
Bright blue.
HE is also Bright blue the 2nd time.
Report Abuse
Jammintoad is online. Jammintoad
Joined: 08 Feb 2009
Total Posts: 10239
27 Jan 2012 07:16 PM
Bump.
Report Abuse
Jammintoad is online. Jammintoad
Joined: 08 Feb 2009
Total Posts: 10239
27 Jan 2012 08:28 PM
Bump. Can't anyone fix this sript? D:
Report Abuse
Jammintoad is online. Jammintoad
Joined: 08 Feb 2009
Total Posts: 10239
27 Jan 2012 09:04 PM
And noone can. :l
Report Abuse
socccerstar is not online. socccerstar
Joined: 23 Aug 2008
Total Posts: 489
27 Jan 2012 09:10 PM
When you use the method ":Destroy()" that disconnects everything. That means the ".Touched:connect()" is done.

Just use ":Remove()" and it should be fixed. If not, debug it with the help of the wonderful Output.
Report Abuse
Jammintoad is online. Jammintoad
Joined: 08 Feb 2009
Total Posts: 10239
27 Jan 2012 10:07 PM
@soccer
"We're sorry, the script you have been trying to fix has not been in fact, fixed. Please try another method. Thank you"
Report Abuse
Jammintoad is online. Jammintoad
Joined: 08 Feb 2009
Total Posts: 10239
27 Jan 2012 10:25 PM
If it helps anyone (It probably won't it's 59 lines of code), but this script interacts with the one I posted above.


    math.randomseed(tick())
    
    -------------------------Tournament Setup------------------------------
    shared.tournamentactivated = false
    shared.teamroundactivated = false
    debounce = false
    function Click()
    print("Function started") --Did not print<--Fixed
    if debounce == false and shared.teamroundactivated == false and shared.tournamentactivated == false then
    shared.tournamentactivated = true
    debounce = true
    for _, ply in pairs(game.Players:GetChildren()) do
    if ply and ply.Character then
    if ply.TeamColor == BrickColor.new("Bright blue") then
    ply.Character:MoveTo(Vector3.new(math.random(21, 49), 947, math.random( -275, -265)))
    else
    ply.Character:MoveTo(Vector3.new(math.random(379, 393), 947, math.random(-61, -45)))
    end
    end
    end
    local h = Instance.new("Message")
    h.Parent = Workspace
    h.Text = "The tournament has been activated"
    lol = true
    shared.e = 0
    shared.c = 0
    wait(5)
    h:Destroy()
    debounce = false
    while lol == true do
    wait(2)
    if shared.e == 8 then
    shared.tournamentactivated = false
    lol = false
    shared.e = 0
    shared.c = 0
    local t = Instance.new("Message")
    t.Text = "The bagels have won the tournament!"
    wait(10)
    t:Destroy()
    elseif shared.c == 8 then
    lol = false
    shared.tournamentactivated = false
    shared.e = 0
    shared.c = 0
    local z = Instance.new("Message")
    z.Text = "The Jalepenos have won the tournament"
    wait(10)
    z:Destroy()
    end
    end
    elseif shared.tournamentactivated == true or shared.teamroundactivated == true then
    script.Parent.Parent.Active.Visible = true
    wait(7)
    script.Parent.Parent.Active.Visible = false
    end
    end
    
    script.Parent.MouseButton1Down:connect(Click)

Report Abuse
Jammintoad is online. Jammintoad
Joined: 08 Feb 2009
Total Posts: 10239
27 Jan 2012 10:43 PM
Nevar gonna get fixed, but I bother bumpin' cuz I hope. Because hope is all we have.
Report Abuse
Jammintoad is online. Jammintoad
Joined: 08 Feb 2009
Total Posts: 10239
27 Jan 2012 11:06 PM
The 8th bummmmmmp. Yaaaaaa.
Report Abuse
Jammintoad is online. Jammintoad
Joined: 08 Feb 2009
Total Posts: 10239
27 Jan 2012 11:16 PM
82 views.
More than 50% of you are not trying O:<
That makes me sad :(
Report Abuse
Jammintoad is online. Jammintoad
Joined: 08 Feb 2009
Total Posts: 10239
28 Jan 2012 09:59 AM
T-t-try again.
Report Abuse
wildphillie is not online. wildphillie
Joined: 19 Sep 2008
Total Posts: 24261
28 Jan 2012 12:05 PM
:o
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