#how can i put an animation with a script --> like the image
1 messages · Page 1 of 1 (latest)
so a localscript wont run under it
you can create a script and change its runcontext property to client
that'll make the (now local) script run for every player no matter where it exists
but still theres no .Equipped and .Unequipped events
and tool.Parent = workspace (or something else)
but i can hold it ?
yea mb
can you send it
ofc
this is the whole bed
how can i like do the thing i want to do
because yea the problem is just the animation
let me explain
so i have a script that just turn the model into a tool
wait look
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local network = ReplicatedStorage:WaitForChild("Network", 3)
local notifyEvent = network:WaitForChild("Notify", 3)
local Objects = workspace:FindFirstChild("Objects"):GetChildren()
local function ObjectSelected(player: Player, object: Model)
assert(object and player, "Object or player hasn't got received correctly")
local character = player.Character
local objectHandle = object:FindFirstChild("Zone", true)
if not objectHandle then warn("you got no zone part in", object) end
objectHandle.Name = "Handle"
local newTool = Instance.new("Tool")
newTool:SetAttribute("Prix", object:GetAttribute("Prix"))
newTool.Name = object.Name
newTool.CanBeDropped = false
local aerm = character:FindFirstChild("Right Arm") :: BasePart
for i, instance in object:GetChildren() do
if instance.ClassName == "LocalScript" then
instance.Enabled = true
else
instance.Anchored = false
end
instance.Parent = newTool
end
newTool.Parent = character
newTool.Grip = CFrame.new(1.5,0,0) * CFrame.fromOrientation(math.rad(90),0,0)
notifyEvent:FireClient(player, "success", "You can now use this object", 3)
end
local function SetupObjectPress(object: Model)
assert(object, "erm...")
local zone = object:WaitForChild("Zone",5)
if not zone then warn("Couldn't find a suited zone for object", object.Name); return end
local clickDetector = object:FindFirstChildOfClass("ClickDetector")
if not clickDetector then
clickDetector = Instance.new("ClickDetector")
clickDetector.MaxActivationDistance = object:GetAttribute("MaxRange") or 15
clickDetector.Parent = zone
end
clickDetector.MouseClick:Connect(function(player)
ObjectSelected(player, object)
end)
end
for i,object in ipairs(Objects) do
task.spawn(SetupObjectPress, object)
end
btw add three ` + lua after first trio for syntax higlighthing
okok thx :d
try to replace the way you get character in the tool's localscript
local tool = script:FindFirstAncestorOfClass("Tool")
local lp = game.Players.LocalPlayer
local char = lp.Character or lp.CharacterAdded:Wait()
maybe the parents are incorrect
this script is good i just need to make the animation work + put the model / tool upper his head and arms like grow a garden
okok
are there any errors in the output?
did you not see the error?
next time give out the error that would help a lot
anyways
i believe you're not copying the animation
you dont have to put into the tool not gonna lie
something like replicated storage would do
okayy 🥲 its been 3 week im stuck on this and yea
oh bruh
yes..
okay
yeah they didnt match
local anim = script.Animation
it had to be local anim = script.Idle
okay i think i know why
you renamed it?
the reason is that the name in the localscript is incorrect
the animation is called Idle but you wrote Animation
when saving it to a variable
ye i changed its not working
ye this line of code has an error
@sour gyro
trench rat
thx
you
men
you're a life safer
quick tip
dont use toolbox in your games
hi
its trash and ruins it
i don't
i use everything i made
my goal is 0 tool box
oh my bad, i was confused by ro defender stuff
alright alright my bad
it was just checking my first game
oh yea
yea i will do it :D
** You are now Level 6! **
:Stop() the animation on unequip
or even :Destroy() afterwards
animationTrack btw
not the animation thats called idle
oh
you already do that
ye i put this in the end of the script
does it error on :Stop()?
no
oh it errors hence it stops running thats why it doesnt :Stop()
** You are now Level 16! **
remove the animation priority line
if you need it set to action reupload (and possibly overwrite existing one) it with that priority already set
okayy
where
localscript