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: Why does the walkspeed not change back to 16?

Previous Thread :: Next Thread 
llcoolj03 is not online. llcoolj03
Joined: 20 Nov 2011
Total Posts: 6135
29 Nov 2014 08:35 AM
local config = {
object = script.Parent,
debris=game:GetService("Debris"),
creator = script.Parent:WaitForChild("creator"),
};
config.object.Touched:connect(function(hit)
if hit and hit~=nil and hit.Parent~=nil then
local h=hit.Parent:FindFirstChild("Humanoid");
local t=hit.Parent:FindFirstChild("Torso");
if h~=nil and t~=nil then

if config.creator.Value and config.creator.Value~=nil and t:FindFirstChild("FireWeld") then
local plr=game.Players:GetPlayerFromCharacter(hit.Parent);
if plr then
if plr==config.creator.Value then
return;
end
end
h:TakeDamage(5);
elseif (config.creator.Value and config.creator.Value~=nil and t:FindFirstChild("FireWeld") == nil) then
local plr=game.Players:GetPlayerFromCharacter(hit.Parent);
if plr then
if plr==config.creator.Value then
return;
end
end
local d = script.death:Clone();
d.creator.Value = config.creator.Value;
d.Parent = t;
d.Disabled = false;
local p=Instance.new("Part");
p.Name="Effect";
p.BrickColor=BrickColor.new("Pastel light blue");
p.FormFactor="Custom";
p.Size=Vector3.new(2,2,2);
p.Transparency=1;
p.CanCollide=false;
p.TopSurface="Smooth";
p.BottomSurface="Smooth";
local f = Instance.new("Fire");
f.Color=Color3.new(0,.2,.49);
f.Size=15;
f.Heat=25;
f.SecondaryColor=Color3.new(0,.2,.49)
f.Parent=p;
local cf=CFrame.Angles(0,math.pi*2*math.random(),.5*math.random());
p.CFrame=t.CFrame*cf;
local w=Instance.new("Motor");
w.Name="FireWeld";
w.Part0=t;
w.Part1=p;
w.C0=CFrame.Angles(0,math.pi*2*math.random(),.5*math.random());
w.Parent=t;
config.debris:AddItem(p,8);
p.Parent=workspace;
h.WalkSpeed=9;

wait(6)
if h then
h.WalkSpeed=16;
end
if p and p~=nil then
p:Destroy();
end
end
config.object:Destroy();
end
end
end)
wait(.8);
config.object:Destroy();


9+10 is not 21, IT IS 20!
Report Abuse
llcoolj03 is not online. llcoolj03
Joined: 20 Nov 2011
Total Posts: 6135
29 Nov 2014 08:44 AM
b

read the bottom bit


9+10 is not 21, IT IS 20!
Report Abuse
llcoolj03 is not online. llcoolj03
Joined: 20 Nov 2011
Total Posts: 6135
29 Nov 2014 09:00 AM
b


9+10 is not 21, IT IS 20!
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
29 Nov 2014 09:02 AM
"if p and p~=nil then"
Wow. You are doing the same thing twice.
That is horrible.

Just do
"if p then".

Also, there is nothing wrong with the walkspeed changing bit.
Report Abuse
llcoolj03 is not online. llcoolj03
Joined: 20 Nov 2011
Total Posts: 6135
29 Nov 2014 09:21 AM
Sorry it still does not work.


9+10 is not 21, IT IS 20!
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