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 » Scripters
Home Search
 

Re: Major help needed! Please!

Previous Thread :: Next Thread 
coolmatt3 is not online. coolmatt3
Joined: 12 Jul 2010
Total Posts: 778
25 Nov 2015 10:34 PM
This script gives us a gun when we leave Intermission but once the round ends we go back to intermission then spawn on the map again properly but we don't spawn with the guns why?

player = game.Players.LocalPlayer.Backpack
sg = game.Players.LocalPlayer.StarterGear
plr = game.Players.LocalPlayer
gun = game.Lighting["Glock 19"]
pcount = game.Players.NumPlayers

while wait() do
local ex = player:FindFirstChild('Glock 19')
if (workspace.Round.Value == true) and not ex then
local clone = gun:Clone()
clone.Parent = player
end
end


No errors local script in StarterPlayerScripts
Report Abuse
xLink123 is not online. xLink123
Joined: 07 Aug 2014
Total Posts: 11158
25 Nov 2015 10:37 PM
Rather than using LocalPlayer, use a for loop and iterate through Players


Also, don't use Lighting to store things, use ServerStorage
Report Abuse
coolmatt3 is not online. coolmatt3
Joined: 12 Jul 2010
Total Posts: 778
25 Nov 2015 10:37 PM
What do you mean sorry
Report Abuse
mircostaff is online. mircostaff
Joined: 28 Sep 2012
Total Posts: 288
25 Nov 2015 10:39 PM
oh, this is a very, very fix. Your cloning the tool into the player's backpack, which changes after death. If you want the players to keep the tools, than use this loop:

plr = game.Players.LocalPlayer
sg = game.Players.LocalPlayer.StarterGear
gun = game.Lighting["Glock 19"]
pcount = game.Players.NumPlayers

while wait() do
local ex = player:FindFirstChild('Glock 19')
if (workspace.Round.Value == true) and not ex then
local clone = gun:Clone()
clone.Parent = sg
end
end
Report Abuse
coolmatt3 is not online. coolmatt3
Joined: 12 Jul 2010
Total Posts: 778
25 Nov 2015 10:40 PM
No not keep them, I need them to lose them when they die so they won't have them in the lobby but to get them back once a new round starts again
Report Abuse
xLink123 is not online. xLink123
Joined: 07 Aug 2014
Total Posts: 11158
25 Nov 2015 10:41 PM
I'm not sure what you are trying to do, but put the Glock 19 in ServerStorage and use this as needed:

for _, v in players(game.Players:GetPlayers()) do
local backpack = v.BackPack
local glock = game.ServerStorage["Glock 19"]:Clone()
glock.Parent = backpack
end


Haven't tested this, this is completely raw, but I think its correct.
Report Abuse
xLink123 is not online. xLink123
Joined: 07 Aug 2014
Total Posts: 11158
25 Nov 2015 10:41 PM
for _, v in pairs(game.Players:GetPlayers()) do
local backpack = v.BackPack
local glock = game.ServerStorage["Glock 19"]:Clone()
glock.Parent = backpack
end

I noticed a glitch as I posted, use this
Report Abuse
coolmatt3 is not online. coolmatt3
Joined: 12 Jul 2010
Total Posts: 778
25 Nov 2015 10:42 PM
Local or Server?
Report Abuse
coolmatt3 is not online. coolmatt3
Joined: 12 Jul 2010
Total Posts: 778
25 Nov 2015 10:44 PM
Would it work if I do this?


wait(23)--Intermission wait time
for _, v in pairs(game.Players:GetPlayers()) do
local backpack = v.BackPack
local glock = game.ServerStorage["Glock 19"]:Clone()
glock.Parent = backpack
end

wait(180) -- Destroy after game
glock:Destroy()
Report Abuse
xLink123 is not online. xLink123
Joined: 07 Aug 2014
Total Posts: 11158
25 Nov 2015 10:48 PM
No, glock was defined inside the for loop and would be considered "nil"

You would need to do another for loop, this time reversing the effect of the first one and removing the glock, rather than cloning.
Report Abuse
coolmatt3 is not online. coolmatt3
Joined: 12 Jul 2010
Total Posts: 778
25 Nov 2015 10:51 PM
I'll give you some R$ if you make the script for me
Report Abuse
xLink123 is not online. xLink123
Joined: 07 Aug 2014
Total Posts: 11158
25 Nov 2015 10:53 PM
I'll do it for for free
Report Abuse
coolmatt3 is not online. coolmatt3
Joined: 12 Jul 2010
Total Posts: 778
25 Nov 2015 10:54 PM
THANK YOU SO MUCH ME AND MY FRIEND BEEN TRYING ALL DAY LONG
Report Abuse
coolmatt3 is not online. coolmatt3
Joined: 12 Jul 2010
Total Posts: 778
25 Nov 2015 10:57 PM
We just need that script to clone the gun every round or after intermission which is 23 seconds long and then for them to lose it when they die or when the round ends
Report Abuse
Exzeption is not online. Exzeption
Joined: 01 Nov 2011
Total Posts: 1312
25 Nov 2015 10:57 PM
trying to finish the game, not the script (quit makin us look bad bruh)
Report Abuse
coolmatt3 is not online. coolmatt3
Joined: 12 Jul 2010
Total Posts: 778
25 Nov 2015 10:57 PM
That gun script fked us over
Report Abuse
xLink123 is not online. xLink123
Joined: 07 Aug 2014
Total Posts: 11158
25 Nov 2015 11:10 PM
Normal script in game.Workspace:

glock = game.ServerStorage["Glock 19"]
gameTime = 23 -- Change as needed
interTime = 180 -- Change as needed

while true do

wait(interTime)
for _, v in pairs(game.Players:GetPlayers()) do
local backpack = v.Backpack
local glock = game.ServerStorage["Glock 19"]:Clone()
glock.Parent = backpack
end
wait(gameTime)
for _, v in pairs(game.Players:GetPlayers()) do
if v.Backpack:FindFirstChild("Glock 19") then
v.Backpack["Glock 19"]:Destroy()
end
end

end
Report Abuse
Exzeption is not online. Exzeption
Joined: 01 Nov 2011
Total Posts: 1312
25 Nov 2015 11:13 PM
thanks! greatly appreciated!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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