I've been trying to make script when I press a certain key then the wall will show up at a certain position, but for some reason it is not working. I made a UserInputService
UserInputService = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local enable = false
UserInputService.InputBegan:Connect(function(input, isTyping)
if not isTyping then
if not enable then
enable = true
if input.KeyCode == Enum.KeyCode.M then
game.ReplicatedStorage.MudWall:FireServer()
wait(1)
enable = false
end
end
end
end)
I also made the actual wall
local mudwall = game.ServerStorage:WaitForChild("mudwall")
game.ReplicatedStorage.MudWall.OnServerEvent:Connect(function(player)
local character = player.Character or player.CharacterAdded:Wait()
local newMudwall = mudwall:Clone()
newMudwall.Position = Vector3.new(0,0,0)
local TweenService = game:GetService("TweenService")
local part = game.ServerStorage.mudwall
--local part = script.Parent
local info = TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)
local goals = {Size = Vector3.new(16,14,2);}
local tween = TweenService:Create(part,info,goals)
newMudwall.Parent = workspace
wait(1)
tween:Play()
end)
I also made a RemoteEvent for it, but i'm not sure why it's not working. I would be grateful for any help

3 comments
newMudwall.Position = Vector3.new(0,0,0) Can you actually see it? You should try to find the location of 0,0,0 because if its too far away you won't even be able to see it or if its behind a wall
I realized that I had set it to the same position as another brick and changed it but it still won't show up. The only time I see it is when I click the screen and press the button while it's on the loading screen. Even then it only appears at the position where I first created and stored it in the ServerStorage
I fixed the position problem but I can on get it to show by clicking the screen and the button real fast