#help me
126 messages · Page 1 of 1 (latest)
Change the "speed =" at the bottom to something like speed2
Also change the "=speed" to the new variable
wdym?
at the bottom
Lemme rewrite your code
ok
local part = script.Parent
local player = game.Players.LocalPlayer
local character = player.Character
local speed = character.Humanoid.WalkSpeed
local speedvar = 100
part.Anchored = true
part.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
speed2 = speed + speedvar * 10
character.Humanoid.WalkSpeed = speed2
end
end)
oh, i've understanded what u was talking about
try it out
yeah that right
** You are now Level 4! **
OH
I THINK I KNOW
local part = script.Parent
local character = player.Character
local speed = character.Humanoid.WalkSpeed
local speedvar = 100
part.Anchored = true
part.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
speed2 = speed + speedvar * 10
character.Humanoid.WalkSpeed = speed2
end
end)
Try that
Did it work?
not working too
Hm lemme see
wait
are there any logs
like errors showing up
If there are send me a pic
AH
but i already saw it on another scripts o'mine that are working
That's the issue
idk what this means
local part = script.Parent
local character = player
local speed = character.Humanoid.WalkSpeed
local speedvar = 100
part.Anchored = true
part.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
speed2 = speed + speedvar * 10
character.Humanoid.WalkSpeed = speed2
end
end)
try that
this should work 100%
k
breh
one sec
local part = script.Parent
local character = player
local speed = Humanoid.WalkSpeed local speedvar = 100
part.Anchored = true. part.Touched:Connect(function(hit)
local Humanoid = hit.Parent:FindFirstChild("Humanoid")
if Humanoid then
speed2 = speed + speedvar * 10 Humanoid.WalkSpeed = speed2
end
end)
try that
anything?
what error
OH
anyway lemme try again
?
i removed the dot while the game was running
oh lol
no
you are assuming the part that touches it eveery time is a player
make a check like
if hit.Parent:FindFirstChild("Humanoid") then
I added that xd
its getting confused as it thinks you are trying to find the humanoid inside a random part
send ur latest code
local part = script.Parent
local speedVar = 100
part.Touched:Connect(function(hit)
local hum = hit:FindFirstChild('Humanoid')
if hum then
local speed = speed + speedvar * 10
hum.WalkSpeed = speed
end
end)
didnt worked aswell
change variables
local part = script.Parent
local speedVar = 100
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local hum = hit.Parent.Humanoid
local speed = speed + speedvar * 10
hum.WalkSpeed = speed
end
end)
try that
but i got further than cryos script
local part = script.Parent
local speedVar = 100
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local hum = hit.Parent.Humanoid
local speed2 = speed + speedvar * 10
hum.WalkSpeed = speed2
end
end)
so its obviously something with the maths
ye
add local speed = whatever number here
also whats the point in doing speed
on top
local part = script.Parent
local speedVar = 100
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local hum = hit.Parent.Humanoid
local speed = speedvar * 10
hum.WalkSpeed = speed
end
end)
Try this one
i did it
it worked?
ye
which one
uh
this one
epic
thanks u both @simple mirage @waxen socket
the issue I found with it was how you put speed = speed
yeah when i look at that more actually
it was like
saying 16 = 16 + newspeed x 10
kinda goofy
ye
trying to do somethig different than just adding like 100 speed
anyway
im learning and this means a lot to me, i'll try to understand each piece of the code
ty
np just make sure not to reference anything u dont know is there
k
for example dont make a variable for the potential character like
hum = hit.Parent.Humanoid
u need to check if it is there first
ok