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: Small Script

Previous Thread :: Next Thread 
CostumeBlitz is not online. CostumeBlitz
Joined: 22 Feb 2010
Total Posts: 381
10 Feb 2016 11:39 PM
wait()

Tool = script.Parent
Container = game.Lighting.Tools
Destination = Container

while true do wait()
wait(4)
Tool.Parent = Destination
wait()
script:Destroy()
end


--

Its supposed to make the tool its in become a child of a container in lighting, can someone help me fix it?
Report Abuse
Moronism is not online. Moronism
Joined: 08 Feb 2010
Total Posts: 451
11 Feb 2016 12:12 AM
Hopefully I can assist you with the process then.

Firstly, have you considered using an event rather than arbitrarily waiting for minimal intervals of time? It may be much more effective for your purposes, I believe.

Consider using something such as this:

function Change_Parentage(Child)

Child.Parent = game.Lighting.Tools;

wait(4);

script:Destroy();

end

script.Parent.AncestryChanged:connect(Change_Parentage);

The "AncestryChanged" event will execute the "Change_Parentage" when the actual "Parent" of the Tool object itself is altered. The resulting function will first transfer the parent Tool to the desired location within the Lighting table. After four seconds, the script itself will be destroyed.
Report Abuse
ranvlr2o50 is not online. ranvlr2o50
Joined: 30 Jan 2016
Total Posts: 46
11 Feb 2016 06:38 AM

game.players.playeradded:connect(function(plr)
local stats = Instance.new('IntValue', plr)
stats.Name = 'leaderstats'
local experience = Instance.new('IntValue', stats)
experience.Name = 'EXP'
experience.Value = 0
local level = Instance.new('IntValue', stats)
level.Name = 'Level'
level.Value = 0

experience.Changed:Connect(function()
level.Value = math.floor(experience.Value / 1000)
end)
While thruse do
local player = game.Players.LocalPlayer
local leaderstats = player:WaitForChild('leaderstats')
local level = leaderstats:WaitForChild('Level')
local xp = player:WaitForChild('EXP')
level.Changed:connect(function()
if xp.Value < 1000 then
level.Value = 1
end
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