Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to get part to show before click?(described my problem concisely)

Asked by
Donut792 216 Moderation Voter
5 years ago

like the question says im trying to get the part to show on the client side before they click (like follow the mouse) i tried doing a while true do loop but that only made a second part where the first one is at

localscript:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- note to self make sure tool is not requires handle
local Tool = script.Parent
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Mouse = Player:GetMouse()
local Cloth = ReplicatedStorage:FindFirstChild("Cloth")
local Activated = false

Tool.Activated:Connect(function()
    local PositionClicked = Mouse.hit.p
    print(Mouse.Target)
    if Mouse.Target.Name == "Cloth" then
    else
    posX, posY, posZ = PositionClicked.X, PositionClicked.Y, PositionClicked.Z
    game.ReplicatedStorage.ClothEventTwo:FireServer(posX, posY, posZ)
    end
end)

script:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local StoneFoundation = ReplicatedStorage:FindFirstChild("StoneFoundation")

ReplicatedStorage.StoneFoundationEvent.OnServerEvent:Connect(function(Player, posX, posY, posZ)
    local StoneFoundationClone = StoneFoundation:Clone()
    StoneFoundationClone.Parent = workspace
    StoneFoundationClone.Position = Vector3.new(posX, posY, posZ)
    StoneFoundation.Transparency = 1

    local StoneFoundationBlockClone = StoneFoundation.BlockPart:Clone()
    StoneFoundationBlockClone.Parent = workspace
    StoneFoundationBlockClone.Position = Vector3.new(posX, posY, posZ)
    StoneFoundationBlockClone.Transparency = 0

    local StoneFoundationMeshPart = StoneFoundation.Mesh:Clone()
    StoneFoundationMeshPart.Parent = workspace
    StoneFoundationMeshPart.Position = Vector3.new(posX, posY + 9.5, posZ)
    StoneFoundationMeshPart.Transparency = 0

    local Owner = Instance.new("StringValue")
    Owner.Parent = StoneFoundationClone
    Owner.Name = "Owner"
    Owner.Value = Player.Name
end)
0
Mouse.hit is deprecated, use Mouse.Hit. CFrame.p is also deprecated, use CFrame.Position. So you would use Mouse.Hit.Position User#19524 175 — 5y
0
Thank you but thats not what the question is asking Donut792 216 — 5y

Answer this question