#Basic Fix? (I hope)

158 messages · Page 1 of 1 (latest)

distant talon
#

Not how the Touched Event works the beginning stuff you have is for Localscript and touched is for serverscript

rigid lark
#

so do i move the script to serverscriptstorage

distant talon
rigid lark
#

idk

distant talon
#

you can just put it inside the part

rigid lark
#

the whole script?

distant talon
#

its eligible for workspace yes

rigid lark
#

alr ima try it

distant talon
#

this should be a serverscript

#

also you have

#

errors

#

on the function

rigid lark
#

the bottom one where it has the "if"

#

right

tulip geyser
#

i think i know what your trying to do, i'll come back when im done fixing your problem

rigid lark
#

thank you man

distant talon
# rigid lark 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)

rigid lark
#

`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?

distant talon
#

delete the local player and walkspeed

rigid lark
#

and i put the LocalScript inside the Block?

tulip geyser
# rigid lark thank you man
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!

distant talon
#

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

rigid lark
#

ima try both

tulip geyser
rigid lark
#

Ok

tulip geyser
#

i'll try to figure it out

distant talon
#

Engine ignores LocalScripts in Workspace typically

tulip geyser
#

How?

rigid lark
rich spindleBOT
#

studio** You are now Level 2! **studio

tulip geyser
#

just put the script in the block ig

rigid lark
#

Im probably doing something wrong but none worked

distant talon
#

Tbh take a look at this Server vs Local (Those are trying to change something off Workspace)

distant talon
#

Output

#

Too

rigid lark
#

ok

#

Nothing comes out on the out put

distant talon
rigid lark
#

oh

#

it worked when i put it in charactyerscripts

#

thanks bro

distant talon
# rigid lark oh

My script is just for Server - actually properly shows on Server most obbies use that but anyways

rigid lark
#

Its because the model needs to be shrinked down but I want to make the whole model fit

#

Heres a Picture

distant talon
rigid lark
distant talon
#

Baseparts have that

rigid lark
#

So do i have to ungroup the model?

distant talon
#

just set a primarypart

rigid lark
#

Or could I work around it.

rigid lark
distant talon
#

model primarypart

#

in properties

rigid lark
#

ok

distant talon
#

or maybe just put a triggerpart on the model which is invisible

rigid lark
#

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

rigid lark
tulip geyser
# rigid lark I dont know what to do to cut the hole
  1. make these lines of code inside a regular script object.
  2. put the SCRIPT INSIDE THE BLOCK
  3. 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)
distant talon
#

duplicate + put it in each part

tulip geyser
#

i tested it in R6 and R15

#

and it works

#

so it better be.

distant talon
tulip geyser
#

i think it one time crashed my pc

rigid lark
#

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

tulip geyser
rigid lark
#

it speeds up doesent speed down/reset the speed

distant talon
distant talon
mint oriole
tulip geyser
# rigid lark I want it to only affect whoever stands and walks on the block, but turn off whe...

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)```
mint oriole
#

u should do hit.Parent find first child humanoid or hit.Parent.parent find first child humanoid

#

idk

mint oriole
#

well yes

tulip geyser
#

test me all you want

mint oriole
#

but if a player has

mint oriole
#

well ok then

tulip geyser
#

im going insane.

mint oriole
rigid lark
mint oriole
#

like sunglasses

#

it would do

#

sunglasses.parent find first child humanoid

#

so that wouldnt work

#

not a big deal but its still not 100%

tulip geyser
rigid lark
rich spindleBOT
#

studio** You are now Level 3! **studio

tulip geyser
rich spindleBOT
#

studio** You are now Level 6! **studio

tulip geyser
#

WATCH IT

#

I TESTED IT!!

#

WORKS!!

rigid lark
#

ohhh

tulip geyser
#

you can see the character being speed up for a moment

rigid lark
#

yes i see

#

am i doing it wrong

tulip geyser
#

what is the block's hitbox?

rigid lark
#

as big as the block

tulip geyser
#

im gonna send another video of what i just did

#

but with a bigger block

rigid lark
#

ok

tulip geyser
#

oh

#

i see

#

i know what is happening

#

while the walking animation is playing, when your legs get mid-air, the touching event stops

tulip geyser
# rigid lark ok

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

rigid lark
#

alr

#

and then change the script to affect that invsible block

tulip geyser
#

watch

#

the real part is the bigger and transparent one

#

@rigid lark do you get it?

rigid lark
#

yes

#

but one last question

tulip geyser
#

sure

rigid lark
#

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

tulip geyser
#

i suggest learning scripts before making giant stuff

tulip geyser
#

you can do the same with meshparts

rigid lark
#

ur right

#

meshes

#

thanks bro

tulip geyser
#

this is my best answer

rigid lark
#

ohhhhhhh

#

that actually helps alot for all types of things

tulip geyser
#

one last thing

#

if the meshparts doesnt work

#

then re-create a octagon and union the parts

rigid lark
#

ok

tulip geyser
#

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

rigid lark
#

thanks

rigid lark
# tulip geyser :D

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.