Hi everyone I’m currently working on an Ability Tool System and I only need 4 more abilities so rn I want that when a Tool is activated a part should appear and disappear for few seconds now I asked Chat GPT(IK he’s not good) and I got a Script from him so the reason why I got the Script from Chat GPT is because I want to let u know what I mean I have this LocalScript in the Tool and I also got a Part called “PlatformTemplate” in the Replicated Storage
local tool = script.Parent
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local replicatedStorage = game:GetService("ReplicatedStorage")
local platformTemplate = replicatedStorage:WaitForChild("PlatformTemplate")
local function createPlatform()
local character = player.Character or player.CharacterAdded:Wait()
local platform = platformTemplate:Clone()
platform.Position = character.HumanoidRootPart.Position + Vector3.new(0, 5, 0) -- Adjust height as needed
platform.Parent = workspace
-- Platform disappears after a few seconds
wait(5) -- Change duration as needed
platform:Destroy()
end
tool.Activated:Connect(createPlatform)
Just attempted, and the script works as intended, so unsure where your problem might be.
Would just advise double checking the following:
The script pasted above is stored in a LocalScript.
Said LocalScript is stored under the tool itself, not inside the Handle.
Ensure the spelling of PlatformTemplate is correct and as typed inside the script.
Ensure PlatformTemplate certainly exists as a Child of ReplicatedStorage
Copied the script directly from what you linked, made the tool in a few minutes and it functioned as it should. So would say it’s most likely one of the things listed needs to be fixed.
Any more troubles and I’ll try give some more assistance.
um may I ask what exactly it did?Cuz I have put the Tool in the StarterPack and the Part called PlatformTemplate in the Replicated Storage and the Local Script in the Tool or should I just do normal script instead of Local Script?