#button
27 messages · Page 1 of 1 (latest)
code?
here
-- Script inside the ColorChangeBlock
-- References to the Part and ProximityPrompt
local part = script.Parent
local proximityPrompt = part:FindFirstChild("ProximityPrompt")
-- Define colors
local originalColor = part.Color
local newColor = Color3.fromRGB(50, 205, 50) -- Lime green color
-- Function to change part color
local function changePartColor()
part.Color = newColor
end
-- Function to reset part color after a delay
local function resetPartColor()
wait(2) -- Duration to hold the new color before resetting
part.Color = originalColor
end
-- Function to award money to the player
local function awardMoney(player)
local leaderstats = player:FindFirstChild("leaderstats")
if leaderstats then
local money = leaderstats:FindFirstChild("Money")
if money then
money.Value = money.Value + 10 -- Award 10 money
end
end
end
-- Event listener for the ProximityPrompt Triggered event
proximityPrompt.Triggered:Connect(function(player)
changePartColor()
awardMoney(player)
resetPartColor()
end)
this script basically changes color and gives you money when pressed
and when i put the part that used as the button it wont work when sticked to the server thingy
but if its alone with no object it works perfectly fine
ok so
is this a Model and what is the part, is it individual or a model
dude instead of using that much functions
how about this
yes?
You'll have to make a leaderstats script in following Devforum post = https://devforum.roblox.com/t/how-to-make-leaderstats-in-roblox-studio-for-beginners/1856471
script.Parent.ProximityPrompt.Triggered:Connect(function(plr)
script.Parent.Color = Color3.fromRGB(50,205,50)
local leaderstats = plr:FindFirstChild("leaderstats")
local money = leaderstats.IntValue.Value
money = money + 10
task.wait(2)
script.Parent.Color = Color3.fromRGB(0,255,255)-- original color goes here (which is cyan)
end)
How to make leaderstats in roblox studio | For beginners 1) Make a server script inside ServerScriptService | game.ServerScriptService You can name the script however you want, it doesn’t matter. 2) We need to detect if the player joins First of all, you need to detect if a player joins. We’ll do: game.Players.PlayerAdded:Connect(function...
also, im basically making like a animation if u played flee the facility it will be like that when typing on a keyboard and after 1min of typing animation you get to be able to use the button to install a database in it
** You are now Level 3! **
It's easy; but if you want a time or something then you need deltatime for faster versions (Runservice) or just basic countdown with while true do.
deltatime also adds decimals don't forget.
@loud current wouldu be able to help if i pay u?
i already got the animation i jkust want it to work
no its easy go search on devforum theres answers
i just dont seem to get it.