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: Can someone help me with this script?

Previous Thread :: Next Thread 
Aulait1 is not online. Aulait1
Joined: 25 Apr 2010
Total Posts: 29
23 Jul 2011 10:59 PM
!THIS IS THE WHOLE SCRIPT JUST EDIT THE FUNCTION YOU THINK SHOULD BE EDITED FOR THE REASON WHICH IS NEXT!
This script is Ajedi32'S disaster script, please don't be mean about me using it I'm not the only one who used it (for example TheFurryFox). I need help figuring out how to make a player teleport to a certain location because I changed it to minigame sorta thing. Thanks for helping.


-- Ajedi32

disasters = {"Find the coin", "", "Disaster"} -- This is where you list the names models that you want to use for disasters.
-- 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 = 25 -- The ammount of time that the disaster will be in the game before it is removed.

countdownMessage = "The next minigame will take place in %s seconds." -- The message displayed between disasters. %s will be replaced with the number of seconds left.
disasterMessage = "Minigame: %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
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
TheNewFissy is not online. TheNewFissy
Joined: 03 Jan 2011
Total Posts: 1301
23 Jul 2011 11:00 PM
Character:MoveTo(Vector3)

Put it in your script.
Report Abuse
Aulait1 is not online. Aulait1
Joined: 25 Apr 2010
Total Posts: 29
23 Jul 2011 11:01 PM
Thanks but could you tell me where and btw how can I change the location?
Report Abuse
Aulait1 is not online. Aulait1
Joined: 25 Apr 2010
Total Posts: 29
23 Jul 2011 11:06 PM
bump


(what does bump mean EXACTLY? lol)
Report Abuse
TheNewFissy is not online. TheNewFissy
Joined: 03 Jan 2011
Total Posts: 1301
23 Jul 2011 11:11 PM
You need to give more details. Do you want your script to tele players to ONE location every game or RANDOM locations for each player or a # of locations that are randomly chosen to spawn at.
Report Abuse
Aulait1 is not online. Aulait1
Joined: 25 Apr 2010
Total Posts: 29
23 Jul 2011 11:24 PM
sorry about that. I want them to be all teleported to 150, 45, -158
x = 150; y = 45; z = -158 (the axis)
Report Abuse
Aulait1 is not online. Aulait1
Joined: 25 Apr 2010
Total Posts: 29
23 Jul 2011 11:24 PM
every disaster/minigame (always the same place)
Report Abuse
Aulait1 is not online. Aulait1
Joined: 25 Apr 2010
Total Posts: 29
23 Jul 2011 11:35 PM
bump?
Report Abuse
Aulait1 is not online. Aulait1
Joined: 25 Apr 2010
Total Posts: 29
23 Jul 2011 11:48 PM
I added the teleport part right after the countdown function (is it right?):

-- Ajedi32

disasters = {"Find the coin", "", "Disaster"} -- This is where you list the names models that you want to use for disasters.
-- 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 = 25 -- The ammount of time that the disaster will be in the game before it is removed.

countdownMessage = "The next minigame will take place in %s seconds." -- The message displayed between disasters. %s will be replaced with the number of seconds left.
disasterMessage = "Minigame: %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

Character:MoveTo(150, 45, -158) -----This is where I added the teleport script is that right?

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
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
Aulait1 is not online. Aulait1
Joined: 25 Apr 2010
Total Posts: 29
23 Jul 2011 11:57 PM
PLEASE HELP... please?
I'll leave the forum if you help please :|
Report Abuse
kingmod123 is not online. kingmod123
Joined: 16 May 2009
Total Posts: 699
24 Jul 2011 12:49 AM
Uhh, you shouldn't really Double-post, and bump is bumping your thread up to the top of the forum.
Report Abuse
TheNewScripter is not online. TheNewScripter
Joined: 02 Mar 2010
Total Posts: 2432
24 Jul 2011 12:53 AM
B ump
U p
M y
P ost

Just had to say that :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