As of now it will act as if it’s afire potion since it’s the only thing I wrote in that dictionary, you’ll have to add more functions in there yourself, first test out if my theory even works
expected } to close { at line 12 got )
fixed it you don’t need the end) you just need end
My bad! I forgot to double check the code haha
Correct it works, But how do i make it so if i throw a push potion it does the push effects and if fire potion do fire effects
Make functions in that potionfuctions dictionary, making sure the key is a name of a potion and replace
potionfunctions["Fire_Potion"](part)
with
potionfunctions[part.Name](part)
Basically how I did for the Fire Potion but change it up
this gives me a error
local potionfunctions = {
["Fire_Potion"] = function(part)
local fire = game:GetService("ReplicatedStorage").Fire:Clone()
fire.Parent = workspace
fire.Position = part.Position
local time_ = 1
local tween1 = tweenservice:Create(fire, TweenInfo.new(time_),{Size = Vector3.new(9,0.025,9)})
tween1:Play()
tween1.Completed:Wait()
game:GetService("ServerScriptService").ItemSpawn.Spawned.Value -= 1
part:Destroy()
tween1.Completed:Wait()
wait(1)
fire:Destroy()
end
["Push_Potion"] = function(part)
local fire = game:GetService("ReplicatedStorage").Fire:Clone()
fire.Parent = workspace
fire.Position = part.Position
local time_ = 1
local tween1 = tweenservice:Create(fire, TweenInfo.new(time_),{Size = Vector3.new(9,0.025,9)})
tween1:Play()
tween1.Completed:Wait()
game:GetService("ServerScriptService").ItemSpawn.Spawned.Value -= 1
part:Destroy()
tween1.Completed:Wait()
wait(1)
fire:Destroy()
end
}
You forgot to add a comma between each of them
local potionfunctions = {
["Fire_Potion"] = function(part)
local fire = game:GetService("ReplicatedStorage").Fire:Clone()
fire.Parent = workspace
fire.Position = part.Position
local time_ = 1
local tween1 = tweenservice:Create(fire, TweenInfo.new(time_),{Size = Vector3.new(9,0.025,9)})
tween1:Play()
tween1.Completed:Wait()
game:GetService("ServerScriptService").ItemSpawn.Spawned.Value -= 1
part:Destroy()
tween1.Completed:Wait()
wait(1)
fire:Destroy()
end,
["Push_Potion"] = function(part)
local fire = game:GetService("ReplicatedStorage").Fire:Clone()
fire.Parent = workspace
fire.Position = part.Position
local time_ = 1
local tween1 = tweenservice:Create(fire, TweenInfo.new(time_),{Size = Vector3.new(9,0.025,9)})
tween1:Play()
tween1.Completed:Wait()
game:GetService("ServerScriptService").ItemSpawn.Spawned.Value -= 1
part:Destroy()
tween1.Completed:Wait()
wait(1)
fire:Destroy()
end
}
Did I do something wrong?, I’m dumb.
You didn’t add a comma between the 2 keys, that’s why it was erroring, you need to separate each of them via a comma, like how you do with regular tables
yes that would probably be why LOL!
I’m scared… what-what made this happen?!
I’m joking but i know why this is happening.
It’s probably cause there’s no debounce when the part is touched
its because tween didn’t exist
Thank you for all the help today, Everything’s working now!
I’m glad to be of extreme help to you! If you have anymore issues please don’t hesitate to make another post!