#Basic Fix? (I hope)
158 messages · Page 1 of 1 (latest)
so do i move the script to serverscriptstorage
why bro
idk
you can just put it inside the part
the whole script?
its eligible for workspace yes
alr ima try it
i think i know what your trying to do, i'll come back when im done fixing your problem
thank you man
remove the function and entirely do this
land.Touched:Connect(function(hit)
local plrmodel = hit: FindFirstAncestorWhichIsA("Model")
if hit:FindFirstAncestorWhichIsA("Model") then
local humanoid = hit:FindFirstChildWhichIsA("Humanoid")
humanoid.WalkSpeed = 50
end
end)
`local player = game.Players.LocalPlayer
local walkspeed = game.StarterPlayer.CharacterWalkSpeed
local land = game.Workspace.Block
land.Touched:Connect(function(hit)
local plrmodel = hit: FindFirstAncestorWhichIsA("Model")
if hit:FindFirstAncestorWhichIsA("Model") then
local humanoid = hit.Parent:FindFirstChildWhichIsA("Humanoid")
humanoid.WalkSpeed = 50
end
end)`
So this is what the script should be?
delete the local player and walkspeed
and i put the LocalScript inside the Block?
local player = game.Players.LocalPlayer
local walkspeed = game.StarterPlayer.CharacterWalkSpeed
local land = game.Workspace.Block
local Once = true
function WalkSpeed()
walkspeed = 50
end
land.Touched:Connect(function(hit)
if Once == true then
Once = false
WalkSpeed()
end
end)
hope this helps!
land.TouchEnded:Connect(function(hit)
local plrmodel = hit: FindFirstAncestorWhichIsA("Model")
if hit:FindFirstAncestorWhichIsA("Model") then
local humanoid = hit:FindFirstChildWhichIsA("Humanoid")
humanoid.WalkSpeed = 16
end
end)
this is when its ended
ima try both
if an error happens, then copy and paste it to me
Ok
i'll try to figure it out
I don't think LocalScripts work in Workspace
Engine ignores LocalScripts in Workspace typically
How?
do i put your script in the block? or the starterplayer then starterplayerscripts
** You are now Level 2! **
yeah you could do that
just put the script in the block ig
Im probably doing something wrong but none worked
Tbh take a look at this Server vs Local (Those are trying to change something off Workspace)
Show your script then
Output
Too
My script is just for Server - actually properly shows on Server most obbies use that but anyways
I tried making another block that slows you back down and it worked, but when I turned it into multiple it didnt work, it says it says the "Touched" doesent apply
Its because the model needs to be shrinked down but I want to make the whole model fit
Heres a Picture
cause model does not have a touched event
Baseparts have that
So do i have to ungroup the model?
just set a primarypart
Or could I work around it.
whats that
ok
or maybe just put a triggerpart on the model which is invisible
ill do that
i need to make a little hole in the middle for the part that makes you fast
Thats why I even had to make the model
I dont know what to do to cut the hole
- make these lines of code inside a regular script object.
- put the SCRIPT INSIDE THE BLOCK
- edit it however you want
local Block = script.Parent
local Cooldown = false -- forever
Block.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if Cooldown == false then
Cooldown = true
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
if humanoid then
humanoid.WalkSpeed = 30
print("Speed Changed.")
end
end
end
end)
you can also put the script inside the parts
duplicate + put it in each part
@rigid lark if this script doesnt work then i dont know WHAT will
i tested it in R6 and R15
and it works
so it better be.
alternative way to use it here btw idk why you putting a cooldown value which probably he didn't ask
its to not spam the script over and over again like a million times
i think it one time crashed my pc
Switch of plans
I want it to only affect whoever stands and walks on the block, but turn off when it isnt
turn off anf on means higher and lower speed
local Block = script.Parent
Block.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
if humanoid then
humanoid.WalkSpeed = 30
print("Speed Changed.")
end
end
end)
you asked for it, a version with no cooldown
GetTouchingParts()
it speeds up doesent speed down/reset the speed
Use my touchended function that I made but with this guy's code in it
And change the walkspeed to 16
uhh this wont work for everything
easy, theres an event called "TouchedEnded"
local Block = script.Parent
Block.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
if humanoid then
humanoid.WalkSpeed = 30
print("Speed Changed.")
end
end
end)
Block.TouchEnded:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
if humanoid then
humanoid.WalkSpeed = 16
print("Speed Reverted.")
end
end
end)```
u should do hit.Parent find first child humanoid or hit.Parent.parent find first child humanoid
idk
I TESTED IT.
it worked
well yes
test me all you want
but if a player has
Doesn't matter
well ok then
im going insane.
well ofc it would work, but if a avatar item from the shop got touched instead
When i stand on it it changes speed up then reverts it
like sunglasses
it would do
sunglasses.parent find first child humanoid
so that wouldnt work
not a big deal but its still not 100%
thats because you stopped touching the part
Watch idk and millions of other Roblox Studio videos on Medal, the largest Game Clip Platform.
** You are now Level 3! **
Watch Untitled and millions of other Roblox Studio videos on Medal, the largest Game Clip Platform.
** You are now Level 6! **
ohhh
you can see the character being speed up for a moment
wait what?
what is the block's hitbox?
as big as the block
ok
oh
i see
i know what is happening
while the walking animation is playing, when your legs get mid-air, the touching event stops
all you have to do, is duplicate the block, make it bigger where the character walks into, set its collision off, and make it invisible
i'll do this and send a video of it rq
Watch Untitled and millions of other Roblox Studio videos on Medal, the largest Game Clip Platform.
watch
the real part is the bigger and transparent one
@rigid lark do you get it?
sure
how would i do this in a octagon shape
im making a game where u chase coins around with different events and rounds
and maps
i suggest learning scripts before making giant stuff
but to answer your question
you can do the same with meshparts
one last thing
if the meshparts doesnt work
then re-create a octagon and union the parts
ok
its basically like grouping parts, but instead of it being multiple parts inside a group, its forming the parts together into a single part/union
:D
thanks
ik i shouldve asked u earlier but could u explain your code to me because I've been just looking at free models and trying to understand code but cannot understand them, so I wanna see ur code and your meanings.
@tulip geyser