wewe12212
Centipat
- Katılım
- 4 Mayıs 2022
- Mesajlar
- 279
- Çözümler
- 1
Daha fazla
- Cinsiyet
- Erkek
Merhaba Bir Oyunum Üzerinde Çalışıyorum Bir Obje Mesela : (Bitki) ben bu bitki objesine tıklayınca ona dönüşmek istiyorum W A S D SPACE Tuşları İle o obje iken hareket etmekte istiyorum mesela Tıklıyor Ona Dönüşüyor Bunun Scriptini bu şekilde yazdım çalışmıyor yardımcı olabilecek varmı ?( ayrıca oyun için ekip kuruyorum )
Script :
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local rootPart = character:WaitForChild("HumanoidRootPart")
local bush = game.Workspace.Bitki
local isBush = false
local function onKeyPress(input)
if input.KeyCode == Enum.KeyCode.Space and isBush then
humanoid:Move(Vector3.new(0, 10, 0))
end
end
local function onCharacterAdded(char)
character = char
humanoid = char:WaitForChild("Humanoid")
rootPart = char:WaitForChild("HumanoidRootPart")
end
humanoid.Died:Connect(function()
isBush = false
end)
rootPart.Touched:Connect(function(hit)
if hit.Name == "Bush" and not isBush then
isBush = true
humanoid.WalkSpeed = 16
humanoid.JumpPower = 50
end
end)
game:GetService("UserInputService").InputBegan:Connect(onKeyPress)
player.CharacterAdded:Connect(onCharacterAdded)
Script :
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local rootPart = character:WaitForChild("HumanoidRootPart")
local bush = game.Workspace.Bitki
local isBush = false
local function onKeyPress(input)
if input.KeyCode == Enum.KeyCode.Space and isBush then
humanoid:Move(Vector3.new(0, 10, 0))
end
end
local function onCharacterAdded(char)
character = char
humanoid = char:WaitForChild("Humanoid")
rootPart = char:WaitForChild("HumanoidRootPart")
end
humanoid.Died:Connect(function()
isBush = false
end)
rootPart.Touched:Connect(function(hit)
if hit.Name == "Bush" and not isBush then
isBush = true
humanoid.WalkSpeed = 16
humanoid.JumpPower = 50
end
end)
game:GetService("UserInputService").InputBegan:Connect(onKeyPress)
player.CharacterAdded:Connect(onCharacterAdded)
Bazı Yerler Bush Kalmış Bitki OlacakMerhaba Bir Oyunum Üzerinde Çalışıyorum Bir Obje Mesela : (Bitki) ben bu bitki objesine tıklayınca ona dönüşmek istiyorum W A S D SPACE Tuşları İle o obje iken hareket etmekte istiyorum mesela Tıklıyor Ona Dönüşüyor Bunun Scriptini bu şekilde yazdım çalışmıyor yardımcı olabilecek varmı ?( ayrıca oyun için ekip kuruyorum )
Script :
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local rootPart = character:WaitForChild("HumanoidRootPart")
local bush = game.Workspace.Bitki
local isBush = false
local function onKeyPress(input)
if input.KeyCode == Enum.KeyCode.Space and isBush then
humanoid:Move(Vector3.new(0, 10, 0))
end
end
local function onCharacterAdded(char)
character = char
humanoid = char:WaitForChild("Humanoid")
rootPart = char:WaitForChild("HumanoidRootPart")
end
humanoid.Died:Connect(function()
isBush = false
end)
rootPart.Touched:Connect(function(hit)
if hit.Name == "Bush" and not isBush then
isBush = true
humanoid.WalkSpeed = 16
humanoid.JumpPower = 50
end
end)
game:GetService("UserInputService").InputBegan:Connect(onKeyPress)
player.CharacterAdded:Connect(onCharacterAdded)