Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do i change the size of the part?

why wont the size change

    game.Players.LocalPlayer:GetMouse().KeyDown:connect(function(key)
	if key == tostring(" ")  then
wait(0.2)
		local part = Instance.new("Part")
part.Position = game.Workspace.world_kiIIer.RightFoot.Position
part.Transparency = 1
part.Size = Vector3.new(4, 1, 4)
part.CanCollide = true
part.Anchored = true
wait(2)
part:Destroy()
	end
end)

im trying to make an infinite jump but the size isnt good

1 answer

You are using a deprecated function "KeyDown" let's update it.

local UIS = game:GetService('UserInputService')
 subinput = UIS.InputBegan:connect(function(input,gameProcessedEvent)
 if gameProcessedEvent then return end
     if input.KeyCode == Enum.KeyCode.Space then	
     local part = Instance.new("Part")
     part.Position = game.Workspace.world_kiIIer.RightFoot.Position
     part.Transparency = 1
     part.Size = Vector3.new(4, 1, 4)
     part.CanCollide = true
     part.Anchored = true
     wait(2)
     part:Destroy()
     end
 end)

7 comments

0

i forget to say, it should be LocalScript and inside StarterGui or StarterPlayer.StarterCharacterScripts

0

it is exacly that but i need help with the size

0

and with this it wont run if i click space

0

oh, you want a button? i thought you wanted Mouse Click... let me edit.

0

i also knows that the function in my own script works becuase i have used it without the size and it wworks perfectly that way

0

ur script is not working at all and i ONLY needed help with the size, the rest of the script works just fine

0

did you press the space bar?

This discussion is preserved as it was. New answers, comments, and votes are closed.